Intelligent photographing method and system, and related apparatus

ABSTRACT

An intelligent photographing method includes extracting, by a terminal, one or more first tags from common data of a user, where the common data represents an identity feature of the user, extracting, by the terminal, one or more second tags from photographing-related data of the user, where the photographing-related data represents a photographing preference of the user, determining, by the terminal, a third tag based on the one or more first tags and the one or more second tags, and obtaining a picture and adjusting, by the terminal, picture quality of the picture based on a picture quality effect parameter set corresponding to the third tag.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a U.S. National Stage of International PatentApplication No. PCT/CN2018/110247 filed on Oct. 15, 2018, which ishereby incorporated by reference in its entirety.

TECHNICAL FIELD

This application relates to the field of electronic technologies, and inparticular, to an intelligent photographing method and system, and arelated apparatus.

BACKGROUND

With the development of the field of artificial intelligencetechnologies, intelligent terminal devices have also been developed indepth. Taking photos by using an intelligent terminal device to recordevery detail in life has become a way of life for people. Therefore,people pay more attention to a picture effect of a photo taken by usingthe intelligent terminal device.

Currently, after photographing is completed and before a picture formatis formed, the intelligent terminal device first analyzes a photographedobject and an environment of picture data, performs correspondingbeautification processing based on an analysis result, and then furtherforms the picture format by using the beautified picture data. However,because the intelligent terminal device processes the picture data forall users, personalized preferences and requirements of different usersfor photographing effects cannot be met.

SUMMARY

This application provides an intelligent photographing method andsystem, and a related apparatus, to provide a user with a photographingeffect that conforms to a personalized preference of the user, therebyimproving user experience.

According to a first aspect, this application provides an intelligentphotographing method, including: First, a terminal extracts one or morefirst tags from common data of a user. The common data is used torepresent an identity feature of the user. Then, the terminal extractsone or more second tags from photographing-related data of the user. Thephotographing-related data is used to represent a photographingpreference of the user. Next, the terminal determines a third tag basedon the one or more first tags and the one or more second tags. Finally,the terminal adjusts, based on a picture quality effect parameter setcorresponding to the third tag, picture quality of a picture taken bythe terminal.

In this embodiment of this application, the terminal may collect userdata, extract the first tag indicating the identity feature of the user,extract the second tag indicating the photographing preference of theuser, and obtain the third tag of the user through fusion based on thefirst tag and the second tag. In other words, the third tag is obtainedthrough fusing the identity feature of the user with the photographingpreference of the user. Then, the terminal assists, by using the picturequality effect parameter set corresponding to the third tag, the user inphotographing with a photographing effect conforming to a user feature,and provides the user with the photographing effect conforming to a userpersonality, thereby improving user experience.

In a possible ease, that the terminal extracts the one or more firsttags from common data may specifically include: The terminal extracts,based on a first mapping relationship, the one or more first tagscorresponding to the common data. The first mapping relationshipincludes mapping between a plurality of groups of common data and aplurality of first tags. In this way, the terminal may match the commondata with the first mapping relationship, to obtain a common feature tagof the user, that is, the first tag. Therefore, the terminal can quicklyextract the common feature tag of the user.

In a possible ease, that the terminal extracts one or more first tagsfrom photographing-related data may specifically include: First, theterminal extracts one or more first photographing-related parameter setsfrom the photographing-related data. Then, the terminal inputs the oneor more first photographing-related parameter sets to a first neuralnetwork model, to obtain one or more first score vector sets. The firstscore vector set includes first scores of a plurality of fourth tags,and the first score is used to represent a matching degree between thefirst photographing-related parameter set and the fourth tag. Next, theterminal determines the one or more second tags in the plurality offourth tags based on the first score vector sets respectivelycorresponding to the one or more first photographing-related parametersets. In other words, the terminal may extract the feature tag from thephotographing-related data by using the neural network model. In thisway, the terminal may use a self-learning capability of the neuralnetwork model to improve accuracy of extracting the feature tag from thephotographing-related data by the terminal.

In a possible case, the one or more second tags include one or morefourth tags whose first scores are greater than a first threshold in thefirst score vector sets respectively corresponding to the one or morefirst photographing-related parameter sets. In other words, the terminalmay determine, as the one or more second tags, the one or more fourthtags whose fourth scores are greater than the first threshold. Because avalue of the first score is used to indicate a matching degree betweenthe user and the fourth tag, a larger first score indicates a highermatching degree between the photographing-related data of the user andthe fourth tag. In this way, the terminal may extract the one or moresecond tags that conform to a photographing-related data feature of theuser.

In a possible case, the one or more second tags include one or morefourth tags whose first scores are the highest in a first score vectorset corresponding to each first photographing-related parameter set. Inother words, the terminal extracts the one or more fourth tags with thehighest first scores in the first score vector sets of the user, anddetermines the one or more second tags. In this way, the terminal canimprove accuracy of extracting the one or more second tags of the user.

In a possible case, before the terminal inputs the one or more firstphotographing-related parameter sets to a first neural network model,the terminal may obtain sample data. The sample data includes aplurality of groups of first training sets. Each group of first trainingsets include one group of second photographing-related parameter setsand one group of second score vector sets. The terminal trains the firstneural network model based on the sample data by using a deep learningalgorithm, in other words, the terminal may continuously train theneural network model based on the sample data. In this wav, the terminalcan improve accuracy of extracting the one or more second tags of theuser.

In a possible case, the terminal displays a first interface. The firstinterface includes a plurality of sample pictures. Each sample picturecorresponds to one group of second photographing-related parameter setsand one group of second score vector sets. The secondphotographing-related parameter set is used to represent picture qualityof the sample picture, and the second score vector set includes firstscores of a plurality of fourth tags corresponding to the samplepictures. The terminal receives a first, input operation of selectingone or more training pictures from the plurality of sample pictures bythe user. In response to the first input operation, the terminal maydetermine the second photographing-related parameter set and the secondscore vector set that are corresponding to the one or more trainingpictures, as the sample data. In other words, the terminal may train thefirst neural network model by using sample data corresponding to asample picture preselected by the user. In this way, the terminal canextract one or more second feature tags that conform to a personalizedphotographing preference of the user.

In a possible case, the terminal may determine whether a quantity of thesample pictures is less than a training quantity. If the quantity of thesample pictures is less than the training quantity, the terminalselects, as the sample data, one or more groups of secondphotographing-related parameter sets and second score vector sets from aprestored training set database. In other words, the terminal may use aprestored training set to train a first neural network when the quantityof the sample pictures selected by the user is insufficient, therebyreducing input operations of the user and improving user experience.

In a possible case, each first tag and each second tag jointlycorrespond to an association score. A value of the association score isused to represent an association degree between the first tag and thesecond tag. The method specifically includes: First, the terminal maydetermine a total association score T_(i)=L₁*(Σ_(k=1) ^(R)W_(k))+L₂ ofeach second tag based on the one or more first tags and the one or moresecond tags. Herein, T_(i) is a total association score of an i^(th)second tag in the one or more second tags, L₁ is a weight of the one ormore first tags, L₂ is a weight of the one or more second tags, W_(k) isan association score corresponding to a k^(th) first tag in the one ormore first tags and the i^(th) second tag jointly, and R is a quantityof the one or more first tags. Then, the terminal determines the thirdtag based on the total association score of each second tag. The thirdtag is a tag with a highest total association score in the one or moresecond tags. In other words, the terminal may set a weight for the firsttag of the user and a weight for the second tag of the user, and set anassociation degree value corresponding to each first tag and each secondtag. In this way, the terminal can recommend a picture qualityadjustment parameter to the user, to better conform to a personalizedpreference of the user, thereby improving user experience.

According to a second aspect, this application provides a terminal,including one or more processors and one or more memories. The one ormore memories are coupled to the one or more processors. The one or morememories are configured to store computer program code. The computerprogram code includes a computer instruction. When the one or moreprocessors execute the computer instruction, a communications apparatusperforms the intelligent photographing method in any possibleimplementation of any foregoing aspect.

According to a third aspect, an embodiment of this application providesa computer storage medium, including a computer instruction. When thecomputer instruction is run on an electronic device, a communicationsapparatus is enabled to perform the intelligent photographing method inany possible implementation of any foregoing aspect.

According to a fourth aspect, an embodiment of this application providesa computer program product. When the computer program product is run ona computer, the computer is enabled to perform the intelligentphotographing method in any possible implementation of any foregoingaspect.

BRIEF DESCRIPTION OF DRAWINGS

To describe the technical solutions in the embodiments of thisapplication or in the prior art more clearly, the following brieflydescribes the accompanying drawings for describing the embodiments orthe prior art.

FIG. 1 is a schematic structural diagram of a terminal according to anembodiment of this application;

FIG. 2 is a schematic diagram of a software architecture according to anembodiment of this application;

FIG. 3a , FIG. 3b , FIG. 3c , and FIG. 3d are a schematic diagram of agroup of interfaces according to an embodiment of this application;

FIG. 4a , FIG. 4b , FIG. 4c , and FIG. 4d are a schematic diagram ofanother group of interfaces according to an embodiment of thisapplication;

FIG. 5a , and FIG. 5b are a schematic diagram of another group ofinterfaces according to an embodiment of this application;

FIG. 6a , FIG. 6b , FIG. 6c , and FIG. 6d is a schematic diagram ofanother group of interfaces according to an embodiment of thisapplication;

FIG. 7 is a schematic architectural diagram of an intelligentphotography system according to an embodiment of this application;

FIG. 8 is a schematic flowchart of user data preprocessing according toan embodiment of this application;

FIG. 9 is a schematic flowchart of extracting a common data feature of auser according to an embodiment of this application;

FIG. 10a , FIG. 10b , and FIG. 10c are a schematic flowchart ofextracting a photographing-related data feature of a user according toan embodiment of this application;

FIG. 11 is a schematic flowchart of feature tag fusion according to anembodiment of this application;

FIG. 12 is a schematic flowchart of setting a parameter duringphotographing performed by a terminal according to an embodiment of thisapplication;

FIG. 13 is a schematic structural diagram of a user database accordingto an embodiment of this application; and

FIG. 14 is a schematic flowchart of an intelligent photographing methodaccording to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The technical solutions according to embodiments of this application areclearly and completely described in the following with reference to theaccompanying drawings. In description of the embodiments of thisapplication, “/” means “or” unless otherwise specified. For example, A/Bmay represent A or B. In this specification, “and/or” describes only anassociation relationship for describing associated objects andrepresents that three relationships may exist. For example, A and/or Bmay represent the following three cases: Only A exists, both A and Bexist, and only B exists. In addition, in the descriptions in theembodiments of this application, “a plurality of” means two or more thantwo.

The following terms “first” and “second” are merely intended for apurpose of description, and shall not be understood as an indication orimplication of relative importance or implicit indication of the numberof indicated technical features. Therefore, a feature limited by “first”or “second” may explicitly or implicitly include one or more features.In the description of the embodiment of this application, unlessotherwise stated, “a plurality of” means two or more than two.

FIG. 1 is a schematic structural diagram of a terminal 100.

As shown in the FIG. 1, the terminal 100 may include a processor 110, anexternal memory interface 120, an internal memory 121, a universalserial bus (universal serial bus, USB) interface 130, a chargingmanagement module 140, a power management module 141, a battery 142, anantenna 1, an antenna 2, a mobile communications module 150, a wirelesscommunications module 160, an audio module 170, a speaker 170A, areceiver 170B, a microphone 170C, a headset jack 170D, a sensor module180, a button 190, a motor 191, an indicator 192, a camera 193, adisplay screen 194, a subscriber identification module (subscriberidentification module, SIM) card interface 195, and the like. The sensormodule 180 may include a pressure sensor 180A, a gyroscope sensor 180B,a barometric pressure sensor 180C, a magnetic sensor 180D, anacceleration sensor 180E, a distance sensor 180F, an optical proximitysensor 180G, a fingerprint sensor 180H, a temperature sensor 180I, atouch sensor 180K, an ambient light sensor 180L, a bone conductionsensor 180M, and the like.

It may be understood that the illustrated structure in the embodimentsof the present invention does not constitute a specific limitation onthe terminal 100. In some other embodiments of this application, theterminal 100 may include more or fewer components than those shown inthe figure, or some components may be combined, or some components maybe divided, or different component arrangements may be used. Thecomponents shown in the figure may be implemented by hardware, software,or a combination of software and hardware.

The processor 110 may include one or more processing units. For example,the processor HO may include an application processor (applicationprocessor, AP), a modem processor, a graphics processing unit (graphicsprocessing unit, GPU), an image signal processor (image signalprocessor, ISP), a controller, a memory, a video codec, a digital signalprocessor (digital signal processor, DSP), a baseband processor, and/ora neural processing unit (neural-network processing unit, NPU).Different processing units may be independent devices, or may beintegrated into one or more processors.

The controller may be a nerve center and a command center of theterminal 100. The controller may generate an operation control signalbased on instruction operation code and a timing signal, to completecontrol on instruction fetching and execution.

The processor 110 may further include a memory, configured to store aninstruction and data. In some embodiments, the memory in the processor110 is a cache. The memory may store an instruction or data that hasbeers used or cyclically used by the processor 110. If the processor 110needs to use the instruction or the data again, the processor 110 maydirectly invoke the instruction or the data from the memory. This avoidsrepeated access and reduces a waiting time of the processor 110, therebyimproving efficiency of a system.

In some embodiments, the processor 110 may include one or moreinterfaces. The interface may include an integrated circuit(inter-integrated circuit, I2C) interface, an inter-integrated circuitsound (inter-integrated circuit sound, I2S) interface, a pulse codemodulation (pulse code modulation, PCM) interface, a universalasynchronous receiver/transmitter (universal asynchronousreceiver/transmitter, UART) interface, a mobile industry processorinterface (mobile industry processor interface, MIPI), a general-purposeinput/output (general-purpose input/output, GPIO) interface, asubscriber identity module (subscriber identity module, SIM) interface,a universal serial bus (universal serial bus, USB) interface, and/or thelike.

The I2C interface is a two-way synchronization serial bus, including aserial data line (serial data line, SDA) and a serial clock line (derailclock line, SCL). In some embodiments, the processor 110 may include aplurality of groups of I2C buses. The processor 110 may be separatelycoupled to the touch sensor 180K, a charger, a flash, the camera 193,and the like through different I2C bus interfaces. For example, theprocessor 110 may be coupled to the touch sensor 180K through the I2Cinterface, so that the processor 110 communicates with the touch sensor180K through the I2C bus interface, to implement a touch function of theterminal 100.

The I2S interface may be configured to perform audio communication. Insome embodiments, the processor 110 may include a plurality of groups ofI2S buses. The processor 110 may be coupled to the audio module 170 byusing the I2S bus, to implement communication between the processor 110and the audio module 170. In some embodiments, the audio module 170 maytransmit an audio signal to the wireless communications module 160through the I2S interface, to implement a function of answering a callby using a Bluetooth headset.

The PCM interface may also be used in audio communication, to sample,quantize, and code an analog signal. In some embodiments, the audiomodule 170 may be coupled to the wireless communications module 160through a PCM bus interface. In some embodiments, the audio module 170may alternatively transmit an audio signal to the wirelesscommunications module 160 through the PCM interface, to implement afunction of answering a call by using a Bluetooth headset. Both the I2Sinterface and the PCM interface may be used in audio communication.

The UART interface is a universal serial data bus, which is used inasynchronous communication. The bus may be a two-way communications bus,and converts to-be-transmitted data between serial communication andparallel communication. In some embodiments, the UART interface isusually configured to connect the processor 110 to the wirelesscommunications module 160. For example, the processor 110 communicateswith a Bluetooth module in the wireless communications module 160through the UART interface, to implement a Bluetooth function. In someembodiments, the audio module 170 may transmit an audio signal to thewireless communications module 160 through the UART interface, toimplement a function of playing music by using a Bluetooth headset.

The MIPI interface may be configured to connect the processor 110 to aperipheral component such as the display screen 194 or the camera 193.The MIPI interface includes a camera serial interface (camera serialinterface, CSI), a display serial interface (display serial interface,DSI), and the like. In some embodiments, the processor 110 communicateswith the camera 193 through the CSI interface, to implement aphotographing function of the terminal 100. The processor 110communicates with the display screen 194 through the DSI interface, toimplement a display function of the terminal 100.

The GPIO interface may be configured by software. The GPIO interface maybe configured as a control signal or a data signal. In some embodiments,the GPIO interface may be configured to connect the processor 110 to thecamera 193, the display screen 194, the wireless communications module160, the audio module 170, the sensor module 180, and the like. The GPIOinterface may further be configured as the I2C interface, the I2Sinterface, the UART interface, the MIPI interface, or the like.

The USB interface 130 is an interface that conforms to a USB standardspecification, and may be specifically a mini USB interface, a micro USBinterface, a USB Type C interface, or the like. The USB interface 130may be configured to connect to the charger to charge the terminal 100,or may be configured to transmit data between the terminal 100 and aperipheral device. It may also be configured to connect to a headset,and to play audio by using the headset. The interface may bealternatively configured to connect to another electronic device, suchas an AR device.

It may be understood that an interface connection relationship betweenthe modules shown in this embodiment of the present invention is merelyan example for description, and does not constitute a limitation on thestructure of the terminal 100. In some other embodiments of thisapplication, the terminal 100 may alternatively use an interfaceconnection manner different from that in the embodiment, or acombination of a plurality of interface connection manners.

The charging management module 140 is configured to receive a charginginput from the charger. The charger may be a wireless charger or a wiredcharger. In some embodiments of wired charging, the charging management,module 140 may receive a charging input of the wired charger through theUSB interface 130. In some embodiments of wireless charging, thecharging management module 140 may receive a wireless charging input byusing a wireless charging coil of the terminal 100. The chargingmanagement module 140, when charging the battery 142, may further supplypower to the electronic device by using the power management module 141.

The power management module 141 is configured to connect the battery 142and the charging management module 140 to the processor 110. The powermanagement module 141 receives an input of the battery 142 and/or thecharging management module 140, and supplies power to the processor 110,the internal memory 121, an external memory, the display screen 194, thecamera 193, the wireless communications module 160, and the like. Thepower management module 141 may be further configured to monitorparameters such as a battery capacity, a battery cycle count, and abattery health status (electric leakage or impedance). In some otherembodiments, the power management module 141 may alternatively bedisposed in the processor 110. In some other embodiments, the powermanagement module 141 and the charging management module 140 mayalternatively be disposed in a same device.

A wireless communication function of the terminal 100 may be implementedthrough the antenna 1, the antenna 2, the mobile communications module150, the wireless communications module 160, the modem processor, thebaseband processor, and the like.

The antenna 1 and the antenna 2 are configured to transmit and receivean electromagnetic wave signal. Each antenna in the terminal 100 may beconfigured to cover one or more communications frequency bands.Different antennas may be further multiplexed, to improve antennautilization. For example, the antenna 1 may be multiplexed as adiversity antenna in a wireless local area network. In some otherembodiments, the antenna may be used in combination with a timingswitch.

The mobile communications module 150 can provide a solution, applied tothe terminal 100, to wireless communication including 2G, 3G, 4G, 5G,and the like. The mobile communications module 150 may include at leastone filter, a switch, a power amplifier, a low noise amplifier (lownoise amplifier, LNA), and the like. The mobile communications module150 may receive an electromagnetic wave through the antenna 1, performprocessing such as filtering or amplification on the receivedelectromagnetic wave, and transmit the electromagnetic wave to the modemprocessor for demodulation. The mobile communications module 150 mayfurther amplify a signal modulated by the modem processor, and convertthe signal into an electromagnetic wave for radiation through theantenna 1. In some embodiments, at least some function modules in themobile communications module 150 may be disposed in the processor 110.In some embodiments, the at least some function modules in the mobilecommunications module 150 may be disposed in a same device as at leastsome modules in the processor 110.

The modem processor may include a modulator and a demodulator. Themodulator is configured to modulate a to-be-sent low-frequency basebandsignal into a medium or high-frequency signal. The demodulator isconfigured to demodulate a received electromagnetic wave signal Into alow-frequency baseband signal. Then, the demodulator transmits thelow-frequency baseband signal obtained through demodulation to thebaseband processor for processing. The low-frequency baseband signal isprocessed by the baseband processor and then transmitted to theapplication processor. The application processor outputs a sound signalby using an audio device (which is not limited to the speaker 170A, thereceiver 170B, or the like), or displays an image or a video by usingthe display screen 194. In some embodiments, the modem processor may bean independent device. In some other embodiments, the modem processormay be independent of the processor 110, and is disposed in a samedevice as the mobile communications module 150 or another functionmodule.

The wireless communications module 160 may provide a solution, appliedto the terminal 100, for wireless communication including a wirelesslocal area network (wireless local area networks, WLAN) (for example, awireless fidelity (wireless fidelity, Wi-Fi) network), Bluetooth(bluetooth, BT), a global navigation satellite system (global navigationsatellite system, GNSS), frequency modulation (frequency modulation,FM), near field communication (near field communication, NFC), aninfrared (infrared, IR) technology, and the like. The wirelesscommunications module 160 may be one or more components integrating atleast one communications processor module. The wireless communicationsmodule 160 receives an electromagnetic wave through the antenna 2,performs frequency modulation and filtering processing on anelectromagnetic wave signal, and sends a processed signal to theprocessor 110. The wireless communications module 160 may furtherreceive a to-be-sent signal from the processor 110, perform frequencymodulation and amplification on the signal, and convert the signal intoan electromagnetic wave for radiation through the antenna 2.

In some embodiments, the antenna 1 and the mobile communications module150 of the terminal 100 are coupled, and the antenna 2 and the wirelesscommunications module 160 of the terminal 100 are coupled, so that theterminal 100 can communicate with a network and another device by usinga wireless communications technology. The wireless communicationstechnology may include, for example, global system for mobilecommunications (global system tor mobile communications, GSM), generalpacket radio service (general packet radio service, GPRS), code divisionmultiple access (code division multiple access, CDMA), wideband codedivision multiple access (wideband code division multiple access,WCDMA), time-division code division multiple access (time-division codedivision multiple access, TD-SCDMA), long term evolution (long termevolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technologies. TheGNSS may include a global positioning system (global positioning system,GPS), a global navigation satellite system (global navigation satellitesystem, GLONASS), a Beidou navigation satellite system (beidounavigation satellite system, BBS), a quasi-zenith satellite system(quasi-zenith satellite system, QZSS), and/or a satellite-basedaugmentation system (satellite based augmentation systems, SBAS).

The terminal 100 implements the display function by using the GPU, thedisplay screen 194, the application processor, and the like. The GPU isa microprocessor for image processing, and connects the display screen194 to the application processor. The GPU is configured to: performmathematical and geometric calculation, and render an image. Theprocessor 110 may include one or more GPUs, and execute a programinstruction to generate or change display information.

The display screen 194 is configured to display an image, a video, andthe like. The display screen 194 includes a display panel. The displaypanel may be made of a liquid crystal display (liquid crystal display,LCD), an organic light-emitting diode (organic light-emitting diode,OLED), an active-matrix organic light-emitting diode (active-matrixorganic light emitting diode, AMOLED), a flexible light-emitting diode(flex light-emitting diode, FLED), Minded, MicroLed, Micro-oLed, aquantum dot light-emitting diode (quantum dot light emitting diodes,QLED), or the like. In some embodiments, the terminal 100 may includeone or N display screens 194, where N is a positive integer greater than1.

The terminal 100 can implement the photographing function by using theISP, the camera 193, the video codec, the GPU, the display screen 194,the application processor, and the like.

The ISP is configured to process data fed back by the camera 193, Forexample, during photographing, a shutter is opened, a ray of light istransmitted to a light-sensitive element of the camera through a lens,and an optical signal is converted into an electrical signal. Thelight-sensitive element of the camera transmits the electrical signal tothe ISP for processing, and converts the electrical signal into avisible image. The ISP may further optimize an algorithm for noise,luminance, and complexion in an image. The ISP may further optimizeparameters such as exposure and a color temperature of a photographingscenario. In some embodiments, the ISP may be disposed in the camera193.

The camera 193 is configured to capture a static image or a video. Anoptical image of an object is generated through the lens, and isprojected to the light-sensitive element. The light-sensitive elementmay be a charge-coupled device (charge coupled device, CCD) or acomplementary metal-oxide-semiconductor (complementarymetal-oxide-semiconductor, CMOS) phototransistor. The light-sensitiveelement converts an optical signal into an electrical signal, and thentransmits the electrical signal to the ISP to convert the electricalsignal into a digital image signal. The ISP outputs the digital imagesignal to the DSP for processing. The DSP converts the digital imagesignal into an image signal in a standard format such as RGB or YUV. Insome embodiments, the terminal 100 may include one or N cameras 193,where N is a positive integer greater than 1.

The digital signal processor is configured to process a digital signal.In addition to the digital image signal, the digital signal processormay further process another digital signal. For example, when theterminal 100 selects a frequency, the digital signal processor isconfigured to perform Fourier transform on frequency energy and thelike.

The video codec is configured to compress or decompress a digital video.The terminal 100 may support one or more video codecs. In this way, theterminal 100 can play or record videos in a plurality of coding formats,for example, moving picture experts group (moving picture experts group,MPEG)-1, MPEG-2, MPEG-3, and MPEG-4.

The NPU is a neural-network (neural-network, NN) computing processor,which quickly processes input information by referring to a structure ofa biological neural network, for example, by referring to a transfermode between human brain neurons, and may further continuously performself-learning. The NPU can implement applications such as intelligentcognition of the terminal 100, for example, image recognition, facialrecognition, speech recognition, and text understanding.

The external memory interface 120 may be configured to connect to anexternal memory card, for example, a Micro SD card, to extend a storagecapability of the terminal 100. The external memory card communicateswith the processor 110 through the external memory interface 120, toimplement a data storage function. For example, a file such as music ora video is stored in the external memory card.

The internal memory 121 may be configured to store computer-executableprogram code, and the executable program code includes an instruction.The processor 110 runs the instruction stored in the internal memory121, to implement various function applications and data processing ofthe terminal 100. The internal memory 121 may include a program storagearea and a data storage area. The program storage area may store anoperating system, an application required by at least one function (forexample, a sound playing function or an image playing function), and thelike. The data storage area may store data (for example, audio data or aphone book) created in a use process of the terminal 100, and the like.In addition, the internal memory 121 may include a high-speed randomaccess memory, and may further include a nonvolatile memory, forexample, at least one magnetic disk storage device, a flash storagedevice, or a universal flash storage (universal flash storage, UFS).

The terminal 100 can implement an audio function by using the audiomodule 170, the speaker 170A, the receiver 170B, the microphone 170C,the headset jack 170D, the application processor, and the like, forexample, music playing or recording.

The audio module 170 is configured to convert digital audio informationto an analog audio signal for output, and is also configured to convertan analog audio input to a digital audio signal. The audio module 170may be further configured to code and decode an audio signal. In someembodiments, the audio module 170 may be disposed in the processor 110,or some function modules of the audio module 170 are disposed in theprocessor 110.

The speaker 170A, also referred to as a “loudspeaker”, is configured toconvert an audio electrical signal to a sound signal. The terminal 100may be used to listen to music or answer a call in a hands-free modeover the speaker 170A.

The receiver 170B, also referred to as an “earpiece”, is configured toconvert an audio electrical signal to a sound signal. When a call isanswered or audio information is listened to by using the terminal 100,the receiver 170B may be put close to a human ear to listen to a voice.

The microphone 170C, also referred to as a “MIC” or a “soundtransmitter”, is configured to convert a sound signal into an electricalsignal. When making a call or sending voice information, a user may makea sound by moving the human mouth close to the microphone 170C to inputa sound signal to the microphone 170C. At least one microphone 170C maybe disposed in the terminal 100. In some other embodiments, twomicrophones 170C may be disposed in the terminal 100, to collect a soundsignal and further implement a noise reduction function. In some otherembodiments, three, four, or more microphones 170C may alternatively bedisposed in the terminal 100, to collect a sound signal, reduce noise,and further identify a sound source, to implement a directionalrecording function, and the like.

The headset interface 170D is configured to connect to a wired headset.The headset jack 170D may be the USB interface 130, or may be a 3.5 mmopen mobile electronic device platform (open mobile terminal platform,OMTP) standard interface or a cellular telecommunications industryassociation of the USA (cellular telecommunications industry associationof the USA, CTIA) standard interface.

The pressure sensor 180A is configured to sense a pressure signal, andcan convert the pressure signal into an electrical signal. In someembodiments, the pressure sensor 180A may be disposed on the displayscreen 194. There are many types of pressure sensors 180A such as aresistive pressure sensor, an inductive pressure sensor, and acapacitive pressure sensor. The capacitive pressure sensor may includeat least two parallel plates made of conductive materials. When a forceis applied to the pressure sensor 180A, a capacitance between electrodeschanges. The terminal 100 determines pressure intensity based on achange in the capacitance. When a touch operation is performed on thedisplay screen 194, the terminal 100 detects intensity of the touchoperation by using the pressure sensor 180A. The terminal 100 mayfurther calculate a touch location based on a detection signal of thepressure sensor 180A. In some embodiments, touch operations that areperformed at a same touch location but have different touch operationintensity may correspond to different operation instructions. Forexample, when a touch operation whose touch operation intensity is lessthan a first pressure threshold is performed on an SMS messageapplication icon, an instruction for viewing an SMS message isperformed. When a touch operation whose touch operation intensity isgreater than or equal to the first pressure threshold is performed onthe SMS message application icon, an instruction for creating a new SMSmessage is performed.

The gyroscope sensor 180B may be configured to determine a movingposture of the terminal 100. In some embodiments, an angular velocity ofthe terminal 100 around three axes (namely, axes x, y, and z) may bedetermined by using the gyroscope sensor 180B. The gyroscope sensor 180Bmay be configured to implement image stabilization during photographing.For example, when the shutter is pressed, the gyroscope sensor 180Bdetects an angle at which the terminal 100 jitters, calculates, based onthe angle, a distance for which a lens module needs to compensate, andallows the lens to cancel the jitter of the terminal 100 through reversemotion, to implement image stabilization. The gyroscope sensor 180B mayfurther be used in a navigation scenario and a somatic game scenario.

The barometric pressure sensor 180C is configured to measure barometricpressure. In some embodiments, the terminal 100 calculates an altitudeby using the barometric pressure measured by the barometric pressuresensor 180C, to assist in positioning and navigation.

The magnetic sensor 180D includes a Hall sensor. The terminal 100 maydetect opening and closing of a flip leather case by using the magneticsensor 180D. In some embodiments, when the terminal 100 is a flip phone,the terminal 100 may detect, based on the magnetic sensor 180D, whethera flip cover is opened or closed, and further set, based on a detectedopened or closed state of the leather case or the flip cover, a featuresuch as automatic unlocking of the flip cover in response to the openedstate.

The acceleration sensor 180E may detect magnitude of accelerations invarious directions (usually on three axes) of the terminal 100, and maydetect magnitude and a direction of the gravity when the terminal 100 isstill. It may be further configured to recognize a posture of theelectronic device, which is applied to switching between landscapeorientation and portrait orientation, a pedometer, or otherapplications.

The distance sensor 180F is configured to measure a distance. Theterminal 100 may measure the distance in an infrared or a laser manner.In some embodiments, in a photographing scenario, the terminal 100 maymeasure the distance by using the distance sensor 180F to implementquick focusing.

The optical proximity sensor 180G may include, for example, alight-emitting diode (LED) and an optical detector, for example, aphotodiode. The light-emitting diode may be an infrared light-emittingdiode. The terminal 100 emits infrared light by using the light-emittingdiode. The terminal 100 detects infrared reflected light from a nearbyobject by using the photodiode. When sufficient reflected light isdetected, it may be determined that there is an object near the terminal100. When insufficient reflected light is detected, the terminal 100 maydetermine that there is no object near the terminal 100. The terminal100 may detect, by using the optical proximity sensor 180G, that theuser holds the terminal 100 close to an ear to make a call, toautomatically turn off the screen for power saving. The opticalproximity sensor 180G may also be configured to automatically unlock orlock the screen in a leather case mode or a pocket mode.

The ambient light sensor 180L is configured to sense luminance ofambient light. The terminal 100 may adaptively adjust brightness of thedisplay screen 194 based on the sensed ambient light brightness. Theambient light sensor 180L may also be configured to automatically adjustwhite balance during photographing. The ambient light sensor 180L mayfurther cooperate with the optical proximity sensor 180G to detectwhether the terminal 100 is in a pocket, to avoid an accidental touch.

The fingerprint sensor 180H is configured to collect a fingerprint. Theterminal 100 may use a feature of the collected fingerprint to implementfingerprint-based unlocking, application lock access, fingerprint-basedphotographing, fingerprint-based call answering, and the like.

The temperature sensor 180J is configured to detect a temperature. Insome embodiments, the terminal 100 executes a temperature processingpolicy by using the temperature detected by the temperature sensor 180J.For example, when the temperature reported by the temperature sensor180J exceeds a threshold, the terminal 100 lowers performance of aprocessor nearby the temperature sensor 180J, to reduce powerconsumption for thermal protection. In some other embodiments, when thetemperature is lower than another threshold, the terminal 100 heats thebattery 142 to prevent the terminal 100 from being shut down abnormallybecause of a low temperature. In some other embodiments, when thetemperature is lower than still another threshold, the terminal 100boosts an output voltage of the battery 142 to avoid abnormal shutdowncaused by a low temperature.

The touch sensor 180K is also referred to as a “touch panel”. The touchsensor 180K may be disposed on the display screen 194. The touch sensor180K and the display screen 194 form a touchscreen that is also referredto as a “touchscreen”. The touch sensor 180K is configured to detect atouch operation on or near the touch sensor 180K. The touch sensor maytransfer the detected touch operation to the application processor todetermine a type of a touch event. A visual output related to the touchoperation may be provided by using the display screen 194. In some otherembodiments, the touch sensor 180K may further be disposed on a surfaceof the terminal 100 at a location different from that of the displayscreen 194.

The bone conduction sensor 180M may obtain a vibration signal. In someembodiments, the bone conduction sensor 180M may obtain a vibrationsignal of a vibration bone of a human vocal-cord part. The boneconduction sensor 180M may further contact a body pulse to receive ablood pressure beating signal. In some embodiments, the bone conductionsensor 180M may also be disposed in the headset, to obtain a boneconduction headset. The audio module 170 may parse out a voice signalbased on the vibration signal, obtained by the bone conduction sensor180M, of the vibrating bone of the vocal-cord part to implement a voicefunction. The application processor may parse heart rate informationbased on the blood pressure beating signal obtained by the boneconduction sensor 180M, to implement a heart rate detection function.

The button 190 includes a power button, a volume button, and the like.The button 190 may be a mechanical button, or a touch button. Theterminal 100 may receive a button input, and generate a button signalinput related to a user setting and function control of the terminal100.

The motor 191 may generate a vibration prompt. The motor 191 may beconfigured to provide an incoming call vibration prompt and a touchvibration feedback. For example, touch operations performed on differentapplications (for example, photographing and audio playing) maycorrespond to different vibration feedback effects. The motor 191 mayalso correspond to different vibration feedback effects for touchoperations performed on different areas of the display screen 194.Different application scenarios (for example, a time reminder,information receiving, an alarm clock, and a game) may also correspondto different vibration feedback effects. A touch vibration feedbackeffect may be further customized.

The indicator 192 may be an indicator light, and may be configured toindicate a charging status and a power change, or may be configured toindicate a message, a missed call, a notification, and the like.

The SIM card interface 195 is configured to connect to a SIM card. TheSIM card may be inserted into the SIM card interface 195 or detachedfrom the SIM card interface 195, to implement contact with or separationfrom the terminal 100. The terminal 100 may support one or N SIM cardinterfaces, where N is a positive integer greater than 1. The SIM cardinterface 195 may support a Nano SIM card, a Micro SIM card, a SIM card,and the like. A plurality of cards may be inserted into a same SIM cardinterface 195 at the same time. The plurality of cards may be of a sametype or different types. The SIM card interface 195 may further becompatible with different types of SIM cards. The SIM card interface 195may further be compatible with an external memory card. The terminal 100interacts with a network by using the SIM card, to implement functionssuch as conversation and data communication. In some embodiments, theterminal 100 uses an eSIM, namely, an embedded SIM card. The eSIM cardmay be embedded into the terminal 100, and cannot be separated from theterminal 100.

A software system of the terminal 100 may use a layered architecture, anevent-driven architecture, a microkernel architecture, a micro servicearchitecture, or a cloud architecture. In this embodiment of the presentinvention, an Android system with the layered architecture is used as anexample to describe a software structure of the terminal 100.

FIG. 2 is a structural block diagram of software of the terminal 100according to the embodiment of the present invention.

In the layered architecture, software is divided into several layers,and each layer has a clear role and task. The layers communicate witheach other through a software interface. In some embodiments, theAndroid system is divided into four layers: an application layer, anapplication framework layer, an Android runtime (Android runtime) andsystem library, and a kernel layer from top to bottom.

The application layer may include a series of application packages.

As shown in FIG. 2, the application package may include applicationssuch as “Camera”, “Gallery”, “Calendar”, “Calls”, “Maps”, “Navigation”,“WLAN”, “Bluetooth”, “Music”, “Videos”, and “SMS messages”.

The application framework layer provides an application programminginterface (application programming interface, API) and a programmingframework for an application at the application layer. The applicationframework layer includes some predefined functions.

As shown in FIG. 2, the application program framework layer may includea window manager, a content provider, a view system, a phone manager, aresource manager, a notification manager, and the like.

The window manager is configured to manage a window program. The windowmanager may obtain a size of the display screen, determine whether thereis a status bar, perform screen locking, take a screenshot, and thelike.

The content provider is configured to: store and obtain data, and enablethe data to be accessed by an application. The data may include a video,an image, audio, calls that are dialed and received, a browsing historyand bookmarks, an address book, and the like.

The view system includes visual controls such as a control fordisplaying a text and a control for displaying an image. The view systemmay be configured to construct an application. A display interface mayinclude one or more views. For example, a display interface including amessages notification icon may include a text display view and an imagedisplay view.

The phone manager is configured to provide a communication function forthe terminal 100, for example, management of a call status (includinganswering or declining).

The resource manager provides various resources such as a localizedcharacter string, an icon, an image, a layout file, and a video file foran application.

The notification manager enables an application to display notificationinformation in a status bar, and may be configured to convey anotification-type message. The notification manager may automaticallydisappear after a short pause without requiring user interaction. Forexample, the notification manager is configured to notify downloadcompletion, give a message notification, and the like. The notificationmanager may be a notification that appears in a top status bar of thesystem in a form of a graph or a scroll bar text, for example, anotification of an application running on the background, or may be anotification that appears on the screen in a form of a dialog window.For example, text information is displayed in the status bar, a prompttone is played, the electronic device vibrates, or an indicator lightblinks.

The Android runtime includes a core library and a virtual machine. TheAndroid runtime is responsible for scheduling and management of theAndroid system.

The core library includes two parts: a function that needs to be invokedin a java language, and a core library of Android.

The application layer and the application framework layer run on thevirtual machine. The virtual machine executes java files of theapplication layer and the application framework layer as binary files.The virtual machine is configured to implement functions such as objectlife cycle management, stack management, thread management, security andexception management, and garbage collection.

The system library may include a plurality of function modules, forexample, a surface manager (surface manager), a media library (MediaLibraries), a three-dimensional graphics processing library (forexample, OpenGL ES), and a 2D graphics engine (for example, SGL).

The surface manager is configured to manage a display subsystem andprovide fusion of 2D and 3D layers for a plurality of applications.

The media library supports playback and recording in a plurality ofcommonly used audio and video formats, and static image files. The medialibrary may support a plurality of audio and video coding formats suchas MPEG-4, H.264, MP3, AAC, AMR, JPG, and PNG.

The three-dimensional graphics processing library is configured toimplement three-dimensional graphics drawing, image rendering,composition, layer processing, and the like.

The 2D graphics engine is a drawing engine for 2D drawing.

The kernel layer is a layer between hardware and software. The kernellayer includes at least a display driver, a camera driver, an audiodriver, and a sensor driver.

The following describes an example of a working procedure of softwareand hardware of the terminal 100 with reference to a photographingscenario.

When the touch sensor 180K receives a touch operation, a correspondinghardware interrupt is sent to the kernel layer. The kernel layerprocesses the touch operation into an original input event (includinginformation such as touch coordinates and a time stamp of the touchoperation). The original input event is stored at the kernel layer. Theapplication framework layer obtains the original input event from thekernel layer, and identifies a control corresponding to the input event.An example in which the touch operation is a touch tap operation, and acontrol corresponding to the tap operation is a control of a cameraapplication icon is used. A camera application invokes an interface atthe application framework layer to enable the camera application, thenenables the camera driver by invoking the kernel layer, and captures astatic image or a video through the camera 193.

With reference to the accompanying drawings and application scenarios,the following describes in detail an intelligent photographing methodprovided in an embodiment of this application. In the followingembodiment of this application, the terminal may be a terminal 100 shownin FIG. 1 or FIG. 2.

The terminal may receive an input of a user, and enable or disablecollection of user data required for an intelligent photographingfunction in this embodiment of this application. FIG. 3a shows asettings interface 310 displayed on a touch control screen of aterminal. The settings interface 310 may include a system setting bar311 and other setting bars (for example, a sound setting bar, anotification center setting bar, an application management setting bar,a battery setting bar, a storage setting bar, a security and privacysetting bar, and a user and account setting bar). The terminal mayreceive an input operation 312 (for example, tapping) performed by theuser on the system setting bar 311. In response to the input operation312 (for example, tapping), the terminal may display a system settinginterface 320 shown in FIG. 3 b.

As shown in FIG. 3b , the system setting interface 320 may include anintelligence enhancement setting bar 321 and other setting bars (forexample, an about phone setting bar, a system update setting bar, asystem navigation setting bar, a language and input method setting bar,a date and time setting bar, a simple mode setting bar, a data migrationsetting bar, a backup and recovery setting bar, a reset setting bar, auser experience improvement plan setting bar, and a certification marksetting bar). The terminal may receive an input operation 322 (forexample, tapping) performed by the user on the intelligence enhancementsetting bar 322. In response to the input operation 322 (for example,tapping), the terminal may display an intelligence enhancement settinginterface 330 shown in FIG. 3 c.

As shown in FIG. 3c , the intelligence enhancement setting interface 330may include an intelligent suggestion setting bar 331 and other settingbars (for example, “Intelligence enhancement function description” and“About”). The intelligent suggestion setting bar 331 is associated withan intelligent suggestion setting control 332. In FIG. 3c , theintelligent suggestion setting control 332 is in an off state, and theterminal disables the collection of the user data on the terminal. Theterminal may receive an input operation 333 (for example, tapping)performed by the user on the intelligent suggestion setting control 332.In response to the input operation 333, the terminal may switch theintelligent suggestion setting control 332 from the off state to an onstate, and enable intelligent suggestion. When the intelligentsuggestion is enabled, the terminal may collect the user data requiredfor the intelligent photographing function in this embodiment of thisapplication. The user data includes common data andphotographing-related data. The common data may include basic personalinformation, behavior and a habit, an interest and a hobby, and the likeof the user. The photographing-related data may include a photographingpreference, a picture browsing habit, and the like of the user.

After the terminal collects the user data, the terminal may preprocessthe user data. The preprocessed user data may be stored in a database ofthe user. The database of the user may be in a local terminal, or may beon a remote server.

The terminal may pop up a user preference survey interface in a cameraapplication. The user preference survey interface includes one or morepictures. The terminal may receive a picture selection operation (forexample, tapping a picture) performed by the user on the user preferencesurvey interface. In response to the picture selection operation (forexample, tapping a picture) performed by the user on the user preferencesurvey interface, the terminal may collect a photographing-relatedparameter corresponding to a picture selected by the user and aphotographing feature tag score vector set corresponding to the pictureselected by the user.

For example, FIG. 4a shows a home screen 410 displayed on a touchcontrol screen of a terminal. The home screen 410 may include an icon411 of a camera application and icons of other applications (forexample, Alipay, Notes. Music, WeChat, Settings, Dialing, SMS messages,and Contacts). The terminal may receive an input operation 412 (forexample, tapping) performed by a user on the icon 411 of the cameraapplication. In response to the input operation 412, the terminal mayturn on a camera (for example, a front-facing camera or a rear-facingcamera), and display, on the touch control screen, a cameraphotographing interface 420 shown in FIG. 4 b.

As shown in FIG. 4b , the camera photographing interface 420 may includea camera capture display region 423, a camera setting key 421, aphotographing key 425, and the like. The camera capture display region423 is used to display a picture captured by the camera (thefront-facing camera or the rear-facing camera). The terminal may receivean input operation 422 (for example, tapping) performed by the user onthe camera setting key 421. In response to the input operation 422, theterminal may display a camera setting interface 430 shown in FIG. 4 c.

As shown in FIG. 4c , the camera photographing interface 430 may includean intelligent auxiliary photographing setting bar 431 and other settingbars (for example, a resolution setting bar, a geographical locationsetting bar, an automatically added watermark setting bar, a voicecontrol setting bar, an assistive grid setting bar, a gloves modesetting bar, a photographing mute setting bar, a timing photographingsetting bar, and an audio control photographing setting bar). Theintelligent auxiliary photographing setting bar 431 is in an off state.In other words, when performing photographing, the terminal disables anintelligent photographing function provided in this embodiment of thisapplication. The terminal may receive an input operation performed bythe user on the intelligent auxiliary photographing setting bar 431. Inresponse to the input operation performed by the user on the userauxiliary photographing setting bar, the terminal may enable theintelligent photographing function provided in this embodiment of thisapplication. In a possible case, when the terminal receives an inputoperation 432 (for example, tapping) performed by the user on theintelligent auxiliary photographing setting bar 431, in response to theinput operation 432 (for example, tapping) performed by the user for thefirst time, the terminal may display a user preference survey interface440 shown in FIG. 4 d.

As shown in FIG. 4d , the user preference survey interface 440 mayinclude a plurality of groups (for example, 10 groups) of pictures. Eachgroup of pictures may include a plurality of (for example, four)pictures. Each group of pictures have same picture content. However,photographing-related parameter sets P corresponding to differentpictures in each group of pictures are different, and each picturecorresponds to a photographing feature tag (for example, Heavybeautification, Light beautification, Freshness, or Japanese style)score vector set S. The photographing-related parameter set P includes aphotographing parameter set of a picture and a picture quality (picturequality, PQ) effect parameter set of the picture. The photographingparameter set may be {a1, a2, a3, . . . }. A PQ effect parameter may be{a1, a2, a3 . . . }.

For example, the photographing parameter set may be {White balance (a1),ISO (a2), Exposure compensation (a3), Shutter speed (a4), Focusing mode(a5), Metering mode (a6), Luminance (a7), Saturation (a8), Contrast(a9), Acutance (a10) . . . }. The PQ effect parameter set may be used bythe terminal to perform PQ effect adjustment on a picture, for example,picture quality adjustment such as contrast adjustment, luminanceadjustment, color saturation adjustment, hue adjustment, definitionadjustment (for example, digital noise reduction (digital noisereduction, DNR) adjustment), and color edge enhancement (chroma TI, CTI)adjustment. The foregoing examples are merely used to explain thisapplication and shall not be construed as a limitation.

For example, the photographing feature tag score vector set S may be {ascore of Heavy beautification, a score of Light beautification, a scoreof Freshness, a score of Japanese style}. As shown in FIG. 4d , the userpreference interface 440 displays a first group of pictures. The firstgroup of pictures include a picture a, a picture b, a picture c, and apicture d. Photographing-related parameter sets respectivelycorresponding to the four pictures and photographing feature tag scorevector sets S respectively corresponding to the four pictures may beshown in Table 1 below.

TABLE 1 Photographing-related parameter sets and photographing featuretag score vector sets S corresponding to effect pictures Effect Picturenumber Photographing- Photographing picture of an effect related featuretag score group picture parameter set P vector set S First group Picturea P_a S_a Picture b P_b S_b Picture c P_c S_c Picture d P_d S_d

It can be learned from Table 1 that a photographing-related parametercorresponding to the picture a is P_a, and the photographing feature tagscore vector set S_a corresponding to the picture a is {0.6, 0, 0.2,0.2}, which indicates that in the picture a, a score of Heavybeautification is 0.6, a score of Light beautification is 0, a score ofFreshness is 0.2, a score of Japanese style is 0.2, and the like. Thephotographing-related parameter set corresponding to the picture b isP_b, and the photographing feature tag score vector set S_bcorresponding to the picture b is {0, 0.2, 0.4, 0.4}, which indicatesthat in the picture b a score of Heavy beautification is 0, a score ofLight beautification is 0.2, a score of Freshness is 0.4, and a score ofJapanese style is 0.4. The photographing-related parameter setcorresponding to the picture c is P_c, and the photographing feature tagscore vector set S_c corresponding to the picture c is {0, 0.2, 0.8, 0},which indicates that in the picture c, a score of Heavy beautificationis 0, a score of Light beautification is 0.2, a score of Freshness is0.8, and a score of Japanese style is 0. The photographing-relatedparameter set corresponding to the picture d is P_d, and thephotographing feature tag score vector set S_d corresponding to thepicture d is {0, 0.2, 0.2, 0.6}, which indicates that in the picture d,a score of Heavy beautification is 0, a score of Light beautification is0.2, a score of Freshness is 0.2, and a score of Japanese style is 0.6.The foregoing example shown in Table 1 is merely used to explain thisapplication and shall not be construed as a limitation.

A sum of scores of photographing feature tags of the effect picture maybe 1. A higher score of a photographing feature tag in the effectpicture indicates a higher matching degree between aphotographing-related parameter set corresponding to the effect pictureand a photographing-related parameter set corresponding to thephotographing feature tag. In other words, a photographing feature tagwith a higher score better conforms to a feature represented by aphotographing-related parameter of the user.

After the terminal receives the effect picture selected by the user, theterminal may record the photographing-related parameter set P (forexample, the photographing-related parameter set P_b) corresponding tothe effect picture (for example, the picture b) selected by the user,and the photographing feature tag score vector set S (for example, thephotographing feature tag score vector set S_b) corresponding to theeffect picture selected by the user; use the photographing-relatedparameter set P (for example, the photographing-related parameter setP_b) and the photographing feature tag score vector set S (for example,the photographing feature tag score vector set S_b) as a training setQ{P→S} (for example, {P_b→S_b}) of a neural network model; and train theneural network model by using a deep learning algorithm, to obtain amapping function f(x) between the photographing-related parameter set Pand the photographing feature tag score vector set S. In the mappingfunction f(x) of the neural network model, the photographing-relatedparameter set P is used as an input, and the photographing feature tagscore vector set S is used as output. The terminal may input, to theneural network model for training, training parameter sets Q thatinclude photographing-related parameter sets P and photographing featuretag score vector sets S corresponding to a plurality of effect picturesselected by the user, to obtain the mapping function f(x) that betterconforms to a preference of the user. For a specific implementationprocess of the mapping function f(x) for training the neural networkmodel, refer to a neural network training process in the followingembodiment shown in FIG. 10. Details are not described herein again.

For example, as shown in FIG. 4d , the terminal may receive an inputoperation 442 performed by the user on the effect picture (for example,the picture b). In response to the input operation 442, the terminal mayuse, as a group of training sets Q_1 {P_b→S_b}, thephotographing-related parameter set P_b corresponding to the picture band the photographing feature tag score set S_b corresponding to thepicture b; input the training set Q_1 {P_b→S_b} to the neural networkmodel; and train the neural network model by using the deep learningalgorithm, to obtain the mapping function f(x).

In a possible case, the terminal may pop up the user preference surveyinterface when the terminal receives for the first time an operation ofenabling the camera application by the user or receives an operation ofenabling the camera application by the user in each user preferencesurvey period (for example, the terminal surveys a photographingpreference of the user every 10 days), to collect thephotographing-related parameter P corresponding to the picture selectedby the user and the photographing feature tag score vector set Scorresponding to the picture selected by the user. For example, FIG. 5ashows a home screen 510 displayed on a touch control screen of aterminal. The home screen 510 may include an icon 511 of a cameraapplication and icons of other applications (for example, Alipay, Notes,Music. WeChat, Settings, Dialing. SMS messages, and Contacts). Theterminal may receive an input operation 512 (for example, tapping)performed by a user on the icon 511 of the camera application. Inresponse to the input operation 512, the terminal may turn on a camera(for example, a front-facing camera or a rear-facing camera), display,on the touch control screen, a camera photographing interface 520 shownin FIG. 5b , and pop up a user preference survey interface 530 on thecamera photographing interface 520.

As shown in FIG. 5b , the user preference survey interface 530 may bepopped up on the camera photographing interface 520. The user preferencesurvey interface 530 may include a plurality of groups (for example, 10groups) of pictures. Each group of pictures may include a plurality of(for example, four) pictures. Each group of pictures have same picturecontent. However, photographing-related parameter sets P correspondingto different pictures in each group of pictures are different, and eachpicture corresponds to a photographing feature tag (for example, Heavybeautification, Light beautification, Freshness, or Japanese style)score vector set S. The terminal may receive an input operation 532performed by the user on an effect picture 531 (for example, a pictureb). In response to the input operation 532, the terminal may use, as agroup of training sets Q_1{P_b→S_b}, a photographing-related parameterset P_b corresponding to the effect picture 531 (for example, thepicture b) and a photographing feature tag score set S_b correspondingto the effect picture 531 (for example, the picture b); input thetraining set Q_1{P_b→S_b} to a neural network; and train the neuralnetwork by using a deep learning algorithm, to obtain a mapping functionf(x).

After the terminal collects user data (including user common data and aphotographing-related parameter of the user), when a quantity of timesof training the mapping function f(x) in the neural network by using atraining set Q{P→S} is greater than a preset threshold (for example, 10)of the quantity of training times, when the user starts the cameraapplication for photographing, the terminal may perform, by using a PQeffect parameter set corresponding to an intelligent photographing tag(for example, Freshness) matched by the terminal to the user, pictureprocessing on a photo taken by the user, and display the photo on thetouch control screen of the terminal. For a process in which theterminal matches the intelligent photographing tag (for example,Freshness) to the user, refer to the following embodiments shown in FIG.11 and FIG. 12. Details are not described herein.

For example, FIG. 6a shows the home screen 510 displayed on a touchcontrol screen of a terminal. The home screen 510 may include an icon611 of a camera application and icons of other applications (forexample, Alipay. Notes, Music, WeChat. Settings, Dialing, SMS messages,and Contacts). The terminal may receive an input operation 612 (forexample, tapping) performed by a user on the icon 611 of the cameraapplication. In response to the input operation 612, the terminal mayturn on a camera (for example, a front-facing camera or a rear-facingcamera), and display, on the touch control screen, a cameraphotographing interface 620 shown in FIG. 6 b.

As shown in FIG. 6b , the camera photographing interface 620 may displaya picture 621 captured by the camera (for example, the front-facingcamera or the rear-facing camera) and a tag recommendation key 623 of anintelligent photographing tag (for example, Freshness) matched by theterminal to the user. The terminal may receive an input operation 624(for example, tapping) performed by the user on the tag recommendationkey 623. In response to the input operation 624 (for example, tapping),the tag recommendation key 623 may be switched from an off state to anon state. The terminal may enable a function of performing pictureprocessing on the picture 621 taken by the terminal, by using a PQeffect parameter set corresponding to the intelligent photographing tag(for example, Freshness). In a possible case, the terminal may receive are-input operation (for example, tapping) performed by the user on thetag recommendation key 623 in the on state. The tag recommendation key623 may be switched from the on state to the off state. The terminal maydisable the function of performing picture processing on the picture 621taken by the terminal, by using the PQ effect parameter setcorresponding to the intelligent photographing tag (for example,Freshness).

As shown in FIG. 6c , the camera photographing interface 630 may displaya picture 631 captured by the camera (for example, the front-facingcamera or the rear-facing camera), a tag recommendation key 633 of theintelligent photographing tag (for example, Freshness) matched by theterminal to the user, a photographing key 635, and the like. In FIG. 6c, the tag recommendation key 633 is in an on state. In other words, theterminal may enable a function of performing picture processing on thepicture 631 taken by the terminal, by using the PQ effect parameter setcorresponding to the intelligent photographing tag (for example,Freshness). The terminal may receive an input operation 636 (forexample, tapping) performed by the user on the photographing key 635. Inresponse to the input operation 636 (for example, tapping), the terminalmay perform picture processing on the picture 631 taken by the terminal,by using the PQ effect parameter set corresponding to the intelligentphotographing tag (for example, Freshness); and store, in a picturelibrary, the picture obtained after the picture processing. The pictureobtained after the picture processing may be a picture 647 shown in FIG.6d . As shown in FIG. 6d , the terminal may annotate an intelligentphotographing identifier 649 (for example, intelligent photographing)for the picture 647 obtained after the picture processing, and store, inthe picture library, the picture 647 obtained after the pictureprocessing.

The following describes an intelligent photographing system provided inan embodiment of this application.

FIG. 7 is a schematic architectural diagram of an intelligentphotographing system according to an embodiment of this application. Asshown in FIG. 7, the intelligent photographing system 700 may include asystem setting module 710, a data collection module 720, a datapreprocessing module 730, a data storage module 740, a featureextraction module 750, and a parameter setting module 760.

The system setting module 710 may be configured to enable or disable anintelligent photographing function provided in this embodiment of thisapplication.

The data collection module 720 may be configured to: after theintelligent photographing function is enabled, periodically (forexample, a collection period may be 10 days, 15 days, 1 month, orlonger) collect data information of a user on a terminal. The datainformation of the user includes basic personal information (Gender.Year of birth. Habitual residence, and the like), behavior and a habit(a most frequently used APP, an APP with a longest use time, an APP usedafter a headset is plugged in, a frequently visited place, a bedtime,and a wake-up time), an interest and a hobby (a reading preference andan Internet browsing habit), a photographing preference (a photographingparameter, photographed content, and photographed content), and apicture browsing habit (a shared picture, a deleted picture, a collectedpicture, and an edited picture).

The data preprocessing module 730 may be configured to preprocess theuser data collected by the data collection module 720 to extract validdata. For a preprocessing procedure, refer to the following datapreprocessing procedure shown in FIG. 8. Details are not describedherein.

The data storage module 740 may be configured to construct a database tostore the user data (common data and photographing-related data)collected by the data collection module 720, the valid data (thepreprocessed data of the user data) obtained after the datapreprocessing module 730 performs processing, and feature value data (afeature value corresponding to a feature tag) obtained after the featureextraction module 750 performs feature extraction.

The feature extraction module 750 may be configured to extract thefeature tag of the user based on the user data information collected bythe data collection module 720. The feature tag of the user includes acommon feature tag, a photographing feature tag, and a fusion featuretag obtained after a feature tag fusion process of the common featuretag and the photographing feature tag. For the feature tag fusionprocess, refer to the following feature tag fusion process shown in FIG.11 and FIG. 12. Details are not described herein.

The parameter setting module 760 may be configured to perform, based ona fusion feature tag (that is, an intelligent photographing tag) with ahighest score of the user, picture processing on a picture captured by acamera of the terminal; and set, on the picture captured by the camera,a PQ effect parameter corresponding to the fusion feature tag with thehighest score.

The following specifically describes a procedure in which the terminalcollects the user data in this embodiment of this application.

The terminal may collect the user data in an event tracking manner. Tobe specific, the terminal may listen to an event in a softwareapplication running process, and perform determining and capturing whenan event that requires attention occurs. Then, the terminal may obtainrelated information of the event, sort the related information of theevent, and then store, in a local database of the terminal or a remoteserver, the related information of the event. The event listened to bythe terminal may be provided by a platform such as an operating system,a browser, or an application (application, APP) framework; or may be aself-defined trigger event (for example, tapping a specific key) basedon a basic event.

For example, the terminal may listen to an event that the user taps acollect key, a delete key, a share key, or the like in a picture libraryAPP. When the terminal receives that the user taps the collect key on awallpaper picture_1 in a wallpaper APP, the terminal may record thewallpaper picture, use the wallpaper picture_1 as data of a collectedpicture, and store the wallpaper picture_1 in the terminal locally orthe remote server. If the terminal receives that the user taps thedelete key on a wallpaper picture_2 in the wallpaper APP, the terminalmay record the wallpaper picture, use the wallpaper picture_2 as data ofa deleted picture, and store the wallpaper picture_2 in the terminallocally or the remote server. If the terminal receives that the usertaps the share key on a wallpaper picture_3 in the wallpaper APP, theterminal may record the wallpaper picture, use the wallpaper picture_3as data of a deleted picture, and store the wallpaper picture_3 in theterminal locally or the remote server. The foregoing examples are merelyused to explain this application and shall not be construed as alimitation.

For example, if the terminal needs to collect statistics about aquantity of times that the user starts an APP and about a time in whichthe user stays in the APP, the terminal may collect the statistics aboutthe quantity of times that the user starts the APP, by listening to anevent that the operating system starts the APP. The quantity of timesthat the APP is started is incremented by 1 when the terminalsuccessfully starts the APP once. The terminal does not record thequantity of times that the APP is started when the terminal enters theAPP again after the user presses a home button to switch to thebackground. The terminal listens to an input operation of entering theAPP by the user and an input operation of exiting the APP by the user,to calculate duration of accessing the APP by the user. The foregoingexamples are merely used to explain this application and shall not beconstrued as a limitation.

In the foregoing event tracking manner, the user data collected by theterminal may include the common data, the photographing-related data,and the like.

The common data may include the basic personal information, the behaviorand the habit, the interest and the hobby, and the like of the user. Aspecific data subtype may be shown in Table 2 below.

TABLE 2 Common data Data type Data subtype Data attribute Common dataBasic personal Gender information Year of birth Habitual residenceBehavior and Most frequently used APP a habit APP with a longest usetime APP used after a headset is plugged in Frequently visited placeBedtime Wake-up time Interest and Reading preference a hobby Internetbrowsing habit

The following can be learned from Table 2.

1. The basic personal information may include Gender, Year of birth.Habitual residence, and the like.

For example, the terminal may obtain, from personal information of aterminal system account (for example, a Huawei account center of aHuawei terminal or an Apple account center (Apple ID) of an Appleterminal), Gender entered by the user before. In a possible case, theterminal may further perform picture analysis on a plurality of photostaken by a front-facing camera of the user, to deduce Gender of theuser. In a possible case, the terminal may further invoke a data accessinterface with access permission provided by a third-party APP (forexample, QQ, WeChat, Taobao, or Weibo), to obtain Gender of the userfrom a server of the third-party APP. The foregoing manner of obtainingGender of the user is merely used to explain this application and shallnot be construed as a limitation. In specific implementation, Gender ofthe user may be alternatively obtained in another manner.

For example, the terminal may obtain, from personal information of asystem account center of the terminal (for example, a Huawei accountcenter of a Huawei terminal or an Apple account center (Apple ID) of anApple terminal), Year of birth entered in the personal information undera system account by the user before. In a possible case, the terminalmay further invoke a data access interface with access permissionprovided by a third-party APP (for example, QQ, WeChat, Taobao, orWeibo), to obtain Year of birth of the user from a server of thethird-party APP. The foregoing manner of obtaining Year of birth of theuser is merely used to explain this application and shall not beconstrued as a limitation. In specific implementation, Year of birth ofthe user may be alternatively obtained in another manner.

For example, the terminal may obtain, from personal information of asystem account center of the terminal (for example, a Huawei accountcenter of a Huawei terminal or an Apple account center (Apple ID) of anApple terminal), Habitual residence (for example, a region in personalinformation in the Huawei account center or a delivery address inpersonal information in the Apple account (Apple ID) center) entered inthe personal information under a system account by the user before. In apossible case, the terminal may further invoke a data access interfacewith access permission provided by a third-party APP (for example, QQ.WeChat, Taobao. Weibo, and Baidu Map), to obtain Habitual residence ofthe user from a server of the third-party APP. The foregoing manner ofobtaining Habitual residence of the user is merely used to explain thisapplication and shall not be construed as a limitation. In specificimplementation, Year of birth of the user may be alternatively obtainedin another manner.

2. The behavior and the habit may include a most frequently used APP, anAPP with a longest use time, an APP that is used after a headset isplugged in, a frequently visited place, a bedtime, a wake-up time, andthe like of the user.

For example, the terminal may record a use record of each APP. The userecord of the APP includes a quantity of times that the APP is startedin a period (for example, one day, one week, or one month), a time inwhich the terminal runs the APP in a period (for example, one day, oneweek, or one month), and an APP used in a period (for example, one day,one week, or one month) after a headset is plugged in the terminal. Theterminal may determine, as the most frequently used APP, an APP that isstarted for a largest quantity of times in a period (for example, oneday, one week, or one month). The terminal may determine an APP thatruns for a longest time in a period (for example, one day, one week, orone month) as the APP with a longest use time. The terminal maydetermine, as the APP used after a headset is plugged in, an APP that isused in a period (for example, one day, one week, or one month) for alargest quantity of times after the headset is plugged in the terminal.A manner of obtaining information about the most frequently used APP,the APP with a longest use time, and the APP used after a headset isplugged in is merely used to explain this application and shall not beconstrued as a limitation. In specific implementation, the mostfrequently used APP, the APP with a longest use time, and the APP usedafter a headset is plugged in that are of the user may be alternativelyobtained in another manner.

For example, during photographing, the terminal may simultaneouslyobtain location information, and record a location and a date at whichthe user takes a picture. Therefore, the terminal may determine thefrequently visited place of the user based on the location and the timeat which the user takes the picture. The frequently visited place of theuser may be a quantity of times that the terminal performs photographingat a same location on different dates. For example, the terminal recordsthat the user takes a picture at the seaside on Jan. 10, 2018, the usertakes a picture in the Nanshan District on Feb. 1, 2018, the user takesa picture in a shopping mall on Mar. 1, 2018, the user takes a pictureat the seaside on Apr. 2, 2018, and the user takes a picture at theseaside on May 1, 2018. The terminal may determine that the frequentlyvisited place of the user is the “seaside”. In a possible case, theterminal may further invoke a data access interface with accesspermission provided by a third-party APP (for example, Baidu Map orAmap), to obtain the frequently visited place of the user from a serverof the third-party APP. The foregoing manner of obtaining the frequentlyvisited place of the user is merely used to explain this application andshall not be construed as a limitation. In specific implementation, thefrequently visited place of the user may be alternatively obtained inanother manner.

For example, when the terminal is on a bed on which the user sleeps, theterminal may detect vibration information (including a vibrationfrequency, a vibration amplitude, and the like) and surrounding soundinformation (a sound amplitude, a sound frequency, and the like) on asurface of the bed by using a plurality of sensors (for example, amotion sensor and a microphone). After the user falls asleep, regularsounds made by the user and breathing of the user or other actions ofthe user may cause regular movement on the surface of the bed.Therefore, when the terminal determines that the vibration informationon the surface of the bed conforms to a bed vibration rule after theuser falls asleep, and when the surrounding sound information of theterminal conforms to a sound rule after the user falls asleep, theterminal may determine a bedtime of the user. In a possible case, theterminal may further monitor information such as a heart rate, a breath,a body temperature, a blood pressure, and movement of the user by usingan auxiliary device (for example, a smartwatch or a smart band), toobtain the bedtime of the user. The foregoing manner of obtaining thebedtime of the user is merely used to explain this application and shallnot be construed as a limitation. In specific implementation, thebedtime of the user may be alternatively obtained in another manner.

For example, the terminal may obtain, by accessing a record in an alarmclock application, an alarm clock time set by the user, to obtain awake-up time of the user. In a possible case, the terminal may detect,by using a motion sensor, an earliest time at which the user picks upthe terminal every day; and determine, as the wake-up time of the user,the earliest time at which the user picks up the terminal. In a possiblecase, the terminal may monitor an earliest time at which the userunlocks the terminal every day, and determine, as the wake-up time ofthe user, the time at which the user unlocks the terminal. The foregoingmanner of obtaining the wake-up time of the user is merely used toexplain this application and shall not be construed as a limitation. Inspecific implementation, the wake-up time of the user may bealternatively obtained in another manner.

3. The interest and the hobby may include a reading preference, anInternet browsing habit, and the like.

For example, the terminal may obtain the reading preference of the userby using a reading application (for example, Huawei Reader on a Huaweiterminal) on the terminal. In a possible case, the terminal may furtherinvoke a data access interface with access permission provided by athird-party APP (for example, WeChat Reader or QQ Reader), to obtain thefrequently visited place of the user from a server of the third-partyAPP. The foregoing manner of obtaining the reading preference of theuser is merely used to explain this application and shall not beconstrued as a limitation. In specific implementation, the frequentlyvisited place of the user may be alternatively obtained in anothermanner.

For example, the terminal may receive an input operation of opening abrowser by the user (for example, tapping an icon of a browserapplication on the home screen of the terminal, or entering “open thebrowser” by using a voice assistant). In response to the input operationof opening the browser by the user, the terminal may display a searchpage of the browser, and the terminal may record search content enteredby the user on the search page of the browser, and extract a keyword(for example, a “scenic spot”) of the search content within a period oftime (for example, one day, one week, or one month). The terminal mayfurther record an accessed network address of the user, and extract atype of the accessed network address of the user (for example, a videowebsite, a travel website, or a shopping website). Herein, the Internetbrowsing habit of the user may include information such as a searchkeyword of the user and an accessed network address type. In specificimplementation, the Internet browsing habit of the user may furtherinclude other information. In a possible case, the terminal may furtherinvoke a data access interface with access permission provided by athird-party APP (for example, Weibo or Baidu), to obtain the Internetbrowsing habit of the user from a server of the third-party APP. Theforegoing manner of obtaining the Internet browsing habit of the user ismerely used to explain this application and shall not be construed as alimitation. In specific implementation, the Internet browsing habit ofthe user may be alternatively obtained in another manner.

The photographing-related data may include a photographing preference, apicture browsing habit, and the like of the user. A specific data typemay be shown in Table 3 below.

TABLE 3 Photographing-related data Data type Subtype Data attributePhotographing Photographing White balance preference parameter ISOExposure compensation Shutter speed Focusing mode Metering modeLuminance Saturation Contrast Acutance Photographing Commonphotographing mode Aperture Portrait mode Food mode Monochrome cameraProfessional photographing 3D dynamic panorama HDR photographing . . .Photographed Portrait content Plant Flower Food Sunrise Sunset . . .Picture browsing Share Picture habit Delete Picture Collect Picture EditPicture

It can be learned from Table 3 that Photographing preference includesthe photographing parameter, the photographing mode, the photographedcontent, and the like. The picture browsing habit includes a sharedpicture, a deleted picture, a collected picture, an edited picture, andthe like.

1. The photographing parameter may include White balance, ISO(international standards organization, ISO), Exposure compensation,Shutter speed, Focusing mode, Metering mode, Luminance, Saturation,Contrast, Acutance, and the like.

For example, the terminal may receive an input operation of enabling acamera application by the user (for example, tapping an icon of thecamera application on the home screen of the terminal, or entering“start a camera” by using the voice assistant). In response to the inputoperation of enabling the camera, the terminal may start the camera anddisplay, on the touch control screen, a picture captured by the camera.When the terminal receives an input operation of setting thephotographing parameter by the user, in response to the input operationof setting the photographing parameter by the user, the terminal mayrecord and collect the photographing parameter set by the user. Forexample, the terminal may perform picture analysis on the sharedpicture, the deleted picture, the collected picture, and the editedpicture of the user, to extract the photographing parameter from thepictures. The foregoing manner of obtaining the photographing parameterof the user is merely used to explain this application and shall not beconstrued as a limitation. In specific implementation, the photographingparameter of the user may be alternatively obtained in another manner.

For example, the photographing parameter that is of the user and that isobtained by the terminal may be shown in Table 4 below.

TABLE 4 Photographing parameter of a user Photographing parameter Datavalue White balance 2400K ISO 100 Exposure compensation +0.5 EV Shutterspeed 1/125 s Focusing mode AF Metering mode Center-weighted meteringLuminance 10 EV Saturation 120 Contrast 100 Acutance MTF 50

It can be learned, from the photographing parameter of the user shown inTable 4, that the photographing parameter of the user is as follows: avalue of White balance is 2400 K, a value of ISO (internationalstandards organization. ISO) is 100, a value of Exposure compensation is+0.5 EV, a value of Shutter speed is 1/125s, Focusing mode is auto focus(auto focus, AF), Metering mode is center-weighted metering, a value ofLuminance is an exposure value (exposure value, EV) of 10, a value ofSaturation is 120, a value of Contrast is 100, and a value of Acutanceis MTF 50. The foregoing Table 4 is merely used to explain thisapplication and shall not be construed as a limitation.

2. The photographing mode may include a common photographing mode, anaperture mode, a portrait mode, a food mode, a monochrome camera mode, aprofessional photographing mode, a 3D dynamic panorama mode, a highdynamic range imaging (high dynamic range imaging, HDR) photographingmode, and the like.

Each photographing mode may correspond to a group ofphotographing-related parameter sets. The photographing-relatedparameter set may include a photographing parameter set {a1, a2, a3, . .. } and a picture quality (picture quality, PQ) effect parameter {b1,b2, b3, . . . }. The PQ effect parameter set may be used by the terminalto perform PQ effect adjustment on a picture, for example, picturequality adjustment such as contrast adjustment, luminance adjustment,color saturation adjustment, hue adjustment, definition adjustment (forexample, digital noise reduction (digital noise reduction, DNR)adjustment), and color edge enhancement (chroma TI, CTI) adjustment.

For example, a correspondence between a photographing mode and aphotographing-related parameter set may be shown in Table 5 below.

TABLE 5 Correspondence between a photographing mode and aphotographing-related parameter set Photographing modePhotographing-related parameter set Common P_1 Aperture P_2 Portrait P_3Food P_4 Monochrome camera P_5 Professional P_6 3D dynamic panorama P_7HDR P_8 . . . . . .

It can be learned from the correspondence shown in Table 5 between aphotographing mode and a photographing-related parameter set that aphotographing-related parameter set corresponding to the commonphotographing mode in the photographing mode is P_1, aphotographing-related parameter set corresponding to the aperturephotographing mode is P_2, a photographing-related parameter setcorresponding to the portrait photographing mode is P_3, aphotographing-related parameter set corresponding to the foodphotographing mode is P_4, a photographing-related parameter setcorresponding to the monochrome camera photographing mode is P_5, aphotographing-related parameter set corresponding to the professionalphotographing mode is P_6, a photographing-related parameter setcorresponding to the 3D dynamic panorama mode is P_7, and aphotographing-related parameter set corresponding to the HDRphotographing mode is P_8. The foregoing Table 5 is merely used toexplain this application and shall not be construed as a limitation.

The terminal may record a photographing mode used by the user each timethe user takes a picture. Therefore, according to the presetcorrespondence between a photographing mode and a photographing-relatedparameter set P, the terminal may determine, as a frequently usedphotographing mode of the user, a photographing mode that is used by theuser for a quantity of times that is greater than a preset quantitythreshold (for example, the preset quantity threshold may be 1, 2, 3, 4,5, or 10).

For example, the photographing-related parameter set corresponding tothe frequently used photographing mode that is of the user and that isobtained by the terminal may be shown in Table 6 below.

TABLE 6 Correspondence between a frequently used photographing mode of auser and a photographing-related parameter set Frequently usedphotographing Photographing-related mode of a user parameter set CommonP_1 Aperture P_2 Portrait P_3 Food P_4 HDR P_8

It can be learned, from the frequently used photographing mode of theuser and the corresponding photographing-related parameter set that areshown in Table 6, that the frequently used photographing mode and thecorresponding photographing-related parameter set that are obtained bythe terminal are respectively a common photographing mode and aphotographing-related parameter set P_1 corresponding to the commonphotographing mode, an aperture mode and a photographing-relatedparameter set P_2 corresponding to the aperture mode, a portrait modeand a photographing-related parameter set P_3 corresponding to theportrait mode, a food mode and a photographing-related parameter set P_4corresponding to the food mode, and an HDR photographing mode and aphotographing-related parameter set P_8 corresponding to the HDRphotographing mode. The foregoing examples shown in Table 6 are merelyused to explain this application and shall not be construed as alimitation.

3. The photographed content may include: a portrait, a plant, a flower,a food, a sunrise, a sunset, and the like.

Each photographing mode may correspond to a group ofphotographing-related parameter sets. The photographing-relatedparameter set includes a photographing parameter set and a PQ effectparameter set. The PQ effect parameter set may be used by the terminalto perform PQ effect adjustment on a picture, for example, picturequality adjustment such as contrast adjustment, luminance adjustment,color saturation adjustment, hue adjustment, definition adjustment (forexample, digital noise reduction (digital noise reduction, DNR)adjustment), and color edge enhancement (chroma TI, CTI).

For example, a correspondence between photographed content and aphotographing-related parameter set may be shown in Table 7 below.

TABLE 7 Correspondence between photographed content and aphotographing-related parameter set Photographing-related Photographedcontent parameter set Portrait P_9 Plant P_10 Flower P_11 Food P_12Sunrise P_13 Sunset P_14 . . . . . .

It can be learned, from the correspondence that is between aphotographing mode and a photographing-related parameter set and that isshown in Table 7, that a photographing-related parameter setcorresponding to photographed portrait content is P_9, aphotographing-related parameter set corresponding to photographed plantcontent is P_10, a photographing-related parameter set corresponding tophotographed flower content is P_11, a photographing-related parameterset corresponding to photographed food content is P_12, aphotographing-related parameter set corresponding to photographedsunrise content is P_13, and a photographing-related parameter setcorresponding to photographed sunset content is P_14. Table 7 is merelyused to explain this application and shall not be construed as alimitation.

The terminal may record photographed content recognized by the terminalthrough the camera each time the user takes a picture. Therefore,according to the preset correspondence between photographed content anda photographing-related parameter set P, the terminal may determine, asfrequently photographed content of the user, photographed content thatis recognized by the terminal through the camera for a quantity of timesthat is greater than a second threshold (for example, the secondthreshold may be 1, 2, 3, 4, 5, or 10) when the user takes a picture.

For example, the frequently photographed content of the user and thephotographing-related parameter set corresponding to the photographedcontent that are obtained by the terminal may be shown in Table 8 below.

TABLE 8 Frequently photographed content of a user and a correspondingphotographing-related parameter set Frequently photographedPhotographing-related content of a user parameter set Portrait P_9 FoodP_12 Sunrise P_13 Sunset P_14

It can be learned, from the frequently photographed content of the userand the corresponding photographing-related parameter set that are shownin Table 8, that the frequently photographed content of the user and thecorresponding photographing-related parameter set that are obtained bythe terminal are photographed portrait content and aphotographing-related parameter set P_9 corresponding to thephotographed portrait content, photographed food content and aphotographing-related parameter set P_12 corresponding to thephotographed food content, photographed sunrise content and aphotographing-related parameter set P_13 corresponding to thephotographed sunrise content, and photographed sunset content and aphotographing-related parameter set P_14 corresponding to thephotographed sunset content. The foregoing example shown in Table 8 ismerely used to explain this application and shall not be construed as alimitation.

4. The picture browsing habit may include a shared picture, a deletedpicture, a collected picture, an edited picture, and the like.

For example, the terminal may receive an input operation of opening aphoto album by the user (for example, tapping an icon of a photo albumapplication on the home screen of the terminal, or entering “open thephoto album” by using the voice assistant). In response to the inputoperation of opening the photo album, the terminal may start the photoalbum application and display a photo album application interface on thetouch control screen. The photo album application interface may includeone or more photos. The terminal may receive a sharing operation, adeleting operation, a collecting operation, an editing operation, or thelike that are performed by the user on a photo in the photo albumapplication. When the terminal receives the sharing operation performedby the user on a photo selected by the user, the terminal may obtain,through picture analysis, a photographing-related parameter setcorresponding to the photo shared by the user. When the terminalreceives the deleting operation performed by the user on a photoselected by the user, the terminal may obtain, through picture analysis,a photographing-related parameter set corresponding to the photo deletedby the user. When the terminal receives the collecting operationperformed by the user on a photo selected by the user, the terminal mayobtain, through picture analysis, a photographing-related parameter setcorresponding to the photo collected by the user. When the terminalreceives the editing operation performed by the user on a photo selectedby the user, the terminal may obtain, through picture analysis, aphotographing-related parameter set corresponding to the photo edited bythe user.

The shared picture, the deleted picture, the collected picture, and theedited picture that are of the user and that are obtained by theterminal, and the photographing-related parameter sets respectivelycorresponding to these pictures may be shown in Table 9 below.

TABLE 9 Picture browsing habit of a user and a photographing- relatedparameter set corresponding to a picture Picture browsing habit PicturePhotographing-related parameter set Share Picture_A P_15 Picture_B P_16Delete Picture_C P_17 Picture_D P_18 Collect Picture_E P_19 Picture_FP_20 Edit Picture_G P_21 Picture_H P_22

It can be learned, from the picture browsing habit of the user and a PQeffect parameter corresponding to a picture that are shown in Table 9,that the shared picture of the user includes the picture_A and thepicture_B, the photographing-related parameter set corresponding to thepicture_A is P_15, and the photographing-related parameter setcorresponding to the picture_B is P_16. The deleted picture of the userincludes the picture_C and the picture_D, the photographing-relatedparameter set corresponding to the picture_C is P_17, and thephotographing-related parameter set corresponding to the picture_D isP_18. The collected picture of the user includes the picture_E and thepicture_F, the photographing-related parameter set corresponding to thepicture_E is P_19, and the photographing-related parameter setcorresponding to the picture_F is P_20. The edited picture of the userincludes the picture_G and the picture_H, the photographing-relatedparameter set corresponding to the picture_G is P_21, and thephotographing-related parameter set corresponding to the picture_H isP_22. Table 9 is merely used to explain this application and shall notbe construed as a limitation.

The following specifically describes a procedure in which the terminalpreprocesses the collected user data in this embodiment of thisapplication.

After the terminal collects the user data, the terminal may preprocessthe collected user data to extract valid source data and store the validsource data in a database.

FIG. 8 shows a schematic flowchart of user data preprocessing. As shownin FIG. 8, a user data preprocessing procedure in FIG. 8 includes thefollowing steps:

1. A terminal determines whether collected user data is common data. Ifthe collected user data is common data, the terminal performs redundantdata removal and abnormal data filtering on the collected common data,and stores, in a database of the user, the common data obtained afterredundant data and abnormal data are removed. The database of the usermay be on the local terminal or on a remote server, which is not limitedherein.

The redundant data removal means that the terminal removes repeated datafrom the collected user data to reduce a size of valid common data to bestored in the database. For example, when the terminal collects the userdata, a plurality of pieces of data may be collected by using differentpaths at each time of data collection performed by the terminal. In datacollected by the terminal at a time, the terminal obtains from a lifeservice application that the user sets a default express deliveryaddress to “Shenzhen”. In this case, the terminal may determine thedefault express delivery address as Habitual residence in the commondata of the user. In other words, the terminal obtains that data ofHabitual residence of the user is “Shenzhen”. In addition, the terminalobtains, by using a positioning service function of a mobile phone, thata location address of the terminal in more than 20 days in one month is“Shenzhen” at night (for example, 23:00 to tomorrow 6:00). In this case,the terminal may determine the location address “Shenzhen” as Habitualresidence of the user. In other words, the terminal obtains that data ofHabitual residence of the user is that “Habitual residence is‘Shenzhen’”. After obtaining the two same pieces of data of Habitualresidence, the terminal may keep one piece of data of Habitual residencedetermined as valid data of Habitual residence, and store the valid datain the database of the user. For another example, when the terminal hasstored “Shenzhen” as Habitual residence of the user in the database ofthe user, one piece of data in the user data collected by the terminalis that Habitual residence of the user is “Shenzhen”, which is the sameas Habitual residence that is of the user and that is stored in thedatabase of the user. In this case, the terminal may remove thecollected piece of data indicating that “Habitual residence of the useris ‘Shenzhen’”. The foregoing examples are merely used to explain thisapplication and shall not be construed as a limitation.

The abnormal data filtering means that the terminal filters out andremoves unreasonable data in the collected user data. Abnormal data maybe generated. Unreasonable data may indicate that the data exceeds avalue range of a data attribute. For example, the terminal may specify avalue of an age data attribute of the user: A value interval of the ageis 0 to 150 years old. If the terminal collects a piece of dataindicating that the user is 200 years old that is not in the valueinterval of the age, the terminal determines that the piece of data isabnormal data, and filters out the abnormal data. The foregoing exampleis merely used to explain this application and shall not be construed asa limitation.

2. When the user data collected by the terminal is not common data, theterminal determines whether the collected user data is a photographingparameter; and if the collected user data is the photographingparameter, the terminal stores the photographing parameter in thedatabase of the user.

The photographing parameter may include White balance, ISO. Exposurecompensation, Shutter speed, Focusing mode. Metering mode, Luminance,Saturation, Contrast, Acutance, and the like.

3. When the user data collected by the terminal is neither common datanor a photographing parameter, if the terminal determines that thecollected user data is a photographing mode or photographed content, theterminal extracts a photographing-related parameter set preset in thephotographing mode or the photographed content, and stores, in thedatabase of the user, the photographing-related parameter set extractedfrom the photographing mode or the photographed content. If no, theterminal determines whether the picture is clear. If the picture isclear, the terminal performs picture analysis on the picture to extracta photographing-related parameter set corresponding to the picture, andstores the photographing-related parameter set in the database of theuser. For example, the terminal may determine whether a value ofdefinition of the picture is greater than a preset definition threshold.If the value of definition of the picture is greater than the presetdefinition threshold, the picture is clear.

The following specifically describes a procedure in which the terminalperforms feature extraction on the user data in this embodiment of thisapplication.

1. The terminal performs feature extraction on the common data of theuser.

FIG. 9 is a flowchart in which a terminal extracts a common data featureof a user according to an embodiment of this application. As shown inFIG. 5, after the intelligent photographing function provided in thisapplication is enabled, the terminal may collect data information of theuser. The data information of the user that is collected by the terminalincludes basic personal information, behavior and a habit, an interestand a hobby, a photographing preference, a picture browsing habit, andthe like of the user. Then, the terminal performs, on the collected userdata, the foregoing preprocessing procedure shown in FIG. 8, to extractvalid source data. Finally, the terminal matches the preprocessed commondata (including basic personal information, behavior and a habit, and aninterest and a hobby) to data in a pre-training common feature taglibrary, and stores, in the database of the user, a feature valuecorresponding to a matching feature tag.

For example, the preprocessed common data of the terminal may be shownin Table 10 below.

TABLE 10 Valid common data Data type Subtype Data attribute Data valueCommon Basic Gender Female data personal Year of birth 1994 informationHabitual residence Shenzhen Behavior Most frequently used Pitu and ahabit APP APP with a longest use WeChat time APP used after aNetEaseMusic headset is plugged in Frequently visited Seaside placeBedtime 23:00 Wake-up time  8:00 Interest Reading preference Romanticfiction and and a hobby fashion magazine Internet browsing Frequentlysearching habit for a keyword “scenic spot”

It can be learned from the valid common data shown in Table 10 that: thebasic personal information of the user is that Gender is Female. Year ofbirth is 1994, and Habitual residence is Shenzhen the behavior and thehabit of the user is that the most frequently used application is Pitu,the APP with a longest use time is WeChat, the APP that is used after aheadset is plugged in is NetFaseMusic, the frequently visited place isseaside, the bedtime is 23:00, and the wake-up time is 8:00; and theinterest and the hobby of the user is that the reading preference isromantic fiction and fashion magazine, and the Internet browsing habitis frequently searching for the keyword “scenic spot”. Table 10 ismerely used to explain this application and shall not be construed as alimitation. In specific implementation, the valid common data of theuser may further include more information.

For example, a pre-training common feature tag library of the terminalmay be shown in Table 11 below.

TABLE 11 Pre-training common feature tag library ID value of a Dataattribute Data value range of a feature tag Feature tag feature tagGender Male Male 0000 Female Female 0001 Year of birth 1978-2018 Youngpeople 0002 (current year: (40 years old and below) 2018) 1959-1977Middle-aged 0003 (41 years old to 59 years old) people Before-1958 Oldpeople 0004 (60 years old and above) Behavior and a A type of an APPthat is frequently used or Music 0005 habit that is used for a longesttime or that is used after a headset is plugged in is “Music” A type ofan APP that is frequently used or Shopping 0006 that is used for alongest time or that is used after a headset is plugged in is “Shopping”A type of an APP that is frequently used or Travel 0007 that is used fora longest time or that is used after a headset is plugged in is “Travel”A type of an APP that is frequently used or Game 0008 that is used for alongest time or that is used after a headset is plugged in is “Game” Atype of an APP that is frequently used or Social activity 0009 that isused for a longest time or that is used after a headset is plugged in is“Social activity” A type of an APP that is frequently used orEntertainment 0010 that is used for a longest time or that is used aftera headset is plugged in is “Entertainment” A type of an APP that isfrequently used or Movie 0011 that is used for a longest time or that isused after a headset is plugged in is “Video” Interest and a A readingpreference type is “Sports Sports 0012 hobby information” and the likeAverage duration of reading an e-book is Reading 0013 more than 30minutes Average duration of browsing news on the News 0014 Internet ismore than 30 minutes information Frequently search the Internet for akeyword Financial 0015 such as “Financial management” or management“Investment” Frequently search the Internet for a keyword Commerce 0016such as “Workplace” or “Work”

It can be learned from the pre-training feature tag library shown inTable 11 that the feature ID value of the feature tag: Male is 0000, andthe feature ID value of the feature tag: Female is 0001. The feature tagcorresponding to Year of birth between 1978 and 2018 is “Young people”,and the feature ID value of the feature tag is 0002. The feature tagcorresponding to Year of birth between 1959 and 1977 is “Middle-agedpeople”, and the feature ID value of the feature tag is 0003. Thefeature tag corresponding to Year of birth before 1958 is “Old people”,and the feature ID value of the feature tag is 0004. A type of an APPthat is frequently used or that is used for a longest time or that isused after a headset is plugged in is “Music” and correspond to thefeature tag “Music” (the feature ID value is 0005). A type of an APPthat is frequently used or that is used for a longest time or that isused after a headset is plugged in is “Shopping” and correspond to thefeature tag “Shopping” (the feature ID value is 0006). A type of an APPthat is frequently used or that is used for a longest time or that isused after a headset is plugged in is “Travel” and correspond to thefeature tag “Travel” (the feature ID value is 0007). A type of an APPthat is frequently used or that is used for a longest time or that isused after a headset is plugged in is “Game” and correspond to thefeature tag “Game” (the feature ID value is 0008). A type of an APP thatis frequently used or that is used for a longest time or that is usedafter a headset is plugged in is “Social activity” and correspond to thefeature tag “Social activity” (the feature ID value is 0009). A type ofan APP that is frequently used or that is used for a longest time orthat is used after a headset is plugged in is “Entertainment” andcorrespond to the feature tag “Entertainment” (the feature ID value is0010). A type of an APP that is frequently used or that is used for alongest time or that is used after a headset is plugged in is “Movie”and correspond to the feature tag “Movie” (the feature ID value is0011). The feature tag corresponding to the read preference type “sportsinformation” is “Sports” (the feature ID value is 0012). The feature tagcorresponding to the average duration of reading an e-book that is morethan 30 minutes is “Reading” (the feature ID value is 0013). The featuretag corresponding to the average duration of browsing news on theInternet that is more than 30 minutes is “News information” (the featureID is value is 0014). The feature tag corresponding to the frequentlysearching the Internet for a keyword such as “Financial management” or“Investment” is “Financial management” (the feature ID value is 0015).The feature tag corresponding to the frequently searching the Internetfor a keyword such as “Workplace” or “Work” is “Commerce” (the featureID value is 0016). Table 11 is merely used to explain this applicationand shall not be construed as a limitation.

With reference to Table 10 and Table 11, the feature tag of the commondata of the user may be shown in Table 12 below.

TABLE 12 Common feature tag of a user and a feature ID valuecorresponding to the common feature tag Common feature Feature ID valuecorresponding tag of a user to the common feature tag Female 0001 Youngpeople 0002 Music 0005 Shopping 0006 Travel 0007 Social activity 0009

It can be learned from the common feature tag of the user shown in Table12 that the common feature tag of the user includes Female (the featureID value is 0001). Young people (the feature ID value is 0002), Music(the common feature ID value is 0004), Shopping (the feature ID value is0006), Travel (the feature ID value is 0007), and Social activity (thefeature ID value is 0009). The terminal may store the foregoing commonfeature tag in the database of the user in a form of a feature ID value.Table 12 is merely used to explain this application and shall not beconstrued as a limitation.

2. The terminal performs feature extraction on the photographing-relateddata of the user.

The following first describes a process in which the terminal trains amapping function f(x) between a photographing-related parameter set Pand a photographing feature tag vector set S by using a neural network(for example, a convolutional neural network (convolutional neuralnetwork, CNN)).

FIG. 10a is a flowchart in which a terminal trains a neural networkaccording to an embodiment of this application. As shown in FIG. 10a ,first, a terminal may prestore several same pictures with different taginformation and in different types. The tag information may be aphotographing feature tag (for example, Heavy beautification, Lightbeautification, Freshness, and Japanese style) score vector set (forexample, (a score of Heavy beautification, a score of Lightbeautification, a score of Freshness, and a score of Japanese style))corresponding to a picture, and a photographing-related parameter setcorresponding to the picture. In a group of pictures, different picturescorrespond to different photographing-related parameter sets (includinga photographing parameter set {a1, a2, a3, . . . } and a PQ effectparameter {b1, b2, b3, . . . }), and correspond to differentphotographing feature tag score vector sets S. Then, the terminal mayselect several groups (for example, 10 groups) for selection by theuser. Next, the terminal may use, as a cold start training parameter setQ{P→S} of the neural network, tag information corresponding to a pictureselected by the user. Herein, P includes a photographing parameter setand a PQ effect parameter set, and S is a score of a photographingfeature tag (for example, Heavy beautification, Light beautification,Freshness, or Japanese style). Finally, the terminal may input thetraining parameter set Q to the neural network (for example, aconvolutional neural network), and obtain a mapping function f(x) byusing a depth learning algorithm.

For example, as shown in the 10 groups of effect pictures shown in FIG.4d , the first group of effect pictures may include the picture a, thepicture b, the picture c, and the picture d. After the terminal receivesan input operation (for example, tapping the picture b) of selecting thepicture b by the user, the terminal may input, as a group of cold starttraining parameter set Q_b{P_b→S_b} to the neural network, thephotographing-related parameter set P_b and the photographing featuretag score vector set S_b that correspond to the picture b, to obtain themapping function f(x) by using the depth learning algorithm. Theterminal may receive a plurality of effect pictures selected by theuser. The cold start training parameter set Q includes not only thephotographing-related parameter set P_b and the photographing featuretag score vector set S_b that correspond to the picture b, but also aphotographing-related parameter set P_e and a photographing feature tagscore vector set S_e that correspond to another picture (for example, apicture e) selected by the user. For a specific part of content that isnot described in detail, refer to the foregoing embodiment shown in FIG.4. In this way, the terminal obtains the training set corresponding tothe effect picture selected by the user, trains the neural network, sothat a photographing feature tag score vector set output by using thetrained training function f(x) conforms to a preference of the user,thereby improving user experience.

In a possible case, the terminal may periodically train the neuralnetwork. For example, a training period T may be 10 days, 15 days, onemonth, or longer.

As shown in FIG. 10b , before training a neural network model, theterminal may determine whether a quantity N of training sets requiredfor this time of training is less than a threshold M (for example, 11).If the quantity N of training sets required for this time of training isless than the threshold M, the terminal may train the neural networkmodel by using a training set (for example, Q_b{P_b→S_b}) including aphotographing-related parameter set (for example, P_b corresponding tothe picture b) and a photographing feature tag score vector set (forexample, S_b corresponding to the picture b) that correspond to apicture selected by the user. If the quantity N of training setsrequired for this time of training is not less than the threshold M, theterminal may input a prestored training set Q_n{P_n→S_n} to the neuralnetwork model. Herein, P_n is a prestored photographing-relatedparameter set for training the neural network model, and S_n isprestored photographing feature tag score vector set for training theneural network model, to obtain the mapping function f(x). A quantity ofprestored training sets is greater than the foregoing threshold M (forexample, 11). In this way, when the neural network model is used totrain the mapping function f(x), a larger quantity of training setsindicates that the photographing feature tag score vector set output bythe terminal by using the trained mapping function f(x) better conformsto a preference of the user. Therefore, when an effect picture manuallyselected by the user corresponds to a relatively small quantity oftraining sets, the terminal may train the neural network model by usinga prestored sample training set, so that the photographing feature tagscore vector set output by using the mapping function f(x) betterconforms to the preference of the user, thereby improving userexperience.

The following describes a process in which the terminal extracts aphotographing feature tag from photographing-related data of the userafter the terminal completes training the neural network model.

As shown in FIG. 10c , after the terminal trains the neural networkmodel to obtain the mapping function f(x), the terminal may input, as aninput vector of the mapping function f(x) to the mapping function f(x)of the neural network model, the photographing-related parameter set Pin the photographing-related data of the user that is collected by theterminal, to output the photographing feature tag score vector set Scorresponding to the photographing-related data of the user. Theterminal may extract a photographing feature tag with a highest score inthe output photographing feature tag score vector set S, use thephotographing feature tag as a photographing feature tag of the user,and store the photographing feature tag in a database of the user.Because the terminal collects a plurality of groups ofphotographing-related parameter sets P (for example, P_1, P_2, P_3, P_4,and P_8) in the photographing-related data of the user that is collectedby the terminal, the terminal successively inputs the plurality ofgroups of photographing-related parameter sets P as input vectors to themapping function f(x), to obtain a plurality of groups of photographingfeature tag score vector sets S. In a possible case, the terminal mayextract a plurality of photographing feature tags from the plurality ofgroups of photographing feature tag score vector sets S.

For example, with reference to Table 6, Table 8, and Table 9, thephotographing-related parameter set P in the photographing-related dataof the user that is collected by the terminal may be shown in Table 13below.

TABLE 13 Photographing-related parameter set in photographing-relateddata of a user Data Photographing-related Data subtype attributeparameter set P Photographing mode Common P_1 Aperture P_2 Portrait P_3Food P_4 HDR P_8 Photographed Portrait P_9 content Food P_12 SunriseP_13 Sunset P_14 Shared picture Picture_A P_15 Picture_B P_16 Deletedpicture Picture_C P_17 Picture_D P_18 Collected picture Picture_E P_19Picture_F P_20 Edited picture Picture_G P_21 Picture_H P_22

It can be learned from Table 13 that the photographing-related parametersets P in the photographing-related data of the user that is collectedby the terminal includes P_1, P_2, P_3, P_4, P_8, P_9, P_12, P_13, P_14,P_15, P_16, P_17, P_18, P_19, P_20, P_21, and P_22. Table 13 is merelyused to explain this application and shall not be construed as alimitation.

The terminal may successively input the plurality of groups ofphotographing-related parameter sets P in Table 13 to the mappingfunction f(x), to obtain the photographing feature tag score vector setsS corresponding to the photographing-related parameter sets P; andextract a photographing feature tag with a highest score from eachphotographing feature tag score vector set S.

For example, the photographing feature tag score vector set S may berepresented as {c1, c2, c3, c4, c5, c6}. Herein, c1 is a score of thephotographing feature tag “Heavy beautification”, c2 is a score of thephotographing feature tag “Light beautification”, c3 is a score of thephotographing feature tag “Freshness”, c4 is a score of thephotographing feature tag “Japanese style”, is a score of aphotographing feature tag “European and American style”, and c6 is ascore of a photographing feature tag “Freshness+Light beatification”.

The photographing feature tag score vector set S corresponding to eachphotographing-related parameter set P in Table 13 and the photographingfeature tag with the highest score in each photographing feature tagscore vector set S may be shown in Table 14 below.

TABLE 14 Photographing feature tag score vector set corresponding toeach photographing-related parameter set and a photographing feature tagwith a highest score Photographing- Photographing feature tagPhotographing related param- score vector set S: feature tag with eterset P {c1, c2, c3, c4, c5, c6} a highest score P_1 S_1: {0.1, 0.3, 0.4,0, 0, 0.2} Freshness P_2 S_2: {0, 0.2, 0.8, 0, 0, 0} Freshness P_3 S_3:{0.1, 0.1, 0.8, 0, 0, 0} Freshness P_4 S_4: {0, 0.2, 0.2, 0.6, 0, 0}Japanese style P_8 S_8: {0, 0.2, 0.6, 0, 0.2, 0} Freshness P_9 S_9: {0,0.2, 0.8. 0, 0, 0} Japanese style P_12 S_12: {0, 0.5, 0.1, 0, 0.2, 0.2}Light beautification P_13 S_13: {0, 0.4, 0, 0.2, 0.3, 0.3} Lightbeautification P_14 S_14: {0, 0.5, 0.2, 0.2, 0.1, 0} Lightbeautification P_15 S_15: {0, 0.1, 0.9, 0, 0, 0} Freshness P_16 S_16:{0, 0.2, 0.4, 0, 0.2, 0.2} Freshness P_17 S_17: {0, 0.2, 0.2, 0.3, 0.2,0.1} Japanese style P_18 S_18: {0, 0.2, 0.2, 0.4, 0, 0.2} Japanese styleP_19 S_19: {0, 0.7, 0.1, 0.1, 0.1, 0} Light beautification P_20 S_20:{0, 0.5, 0.2, 0.3, 0, 0} Light beautification P_21 S_21: {0, 0.2, 0.4,0.1, 0.2, 0.1} Freshness P_22 S_22: {0, 0.2, 0.6, 0.2, 0, 0} Freshness

It can be learned from Table 14 that the terminal performs featureextraction on the photographing-related data of the user. Extractedphotographing feature tags of the user include Light beautification,Freshness, and Japanese style. In addition, the feature ID valuecorresponding to the photographing feature tag may be shown Table 15below.

TABLE 15 Photographing feature tag of a user and a feature ID valuecorresponding to the photographing feature tag Photographing feature tagof a user Feature ID value Light beautification 002 Freshness 003Japanese style 004

It may be learned, from the photographing feature tag of the user andthe feature ID value corresponding to the photographing feature tag thatare shown in Table 15, that the feature ID value corresponding to thephotographing feature tag “Light beautification” of the user is 002, thefeature ID value corresponding to the photographing feature tag“Freshness” of the user is 003, and the feature ID value correspondingto the photographing feature tag “Japanese style” of the user is 004.The terminal may store the foregoing common feature tag in the databaseof the user in a form of a feature ID value. Table 15 is merely used toexplain this application and shall not be construed as a limitation.

In a possible case, the photographing feature tag of the user may be aphotographing feature tag whose score is greater than a first thresholdin each photographing feature tag score vector set S. For example, thefirst threshold may be 0.7. With reference to Table 14, it can belearned that the photographing feature tag of the user includes“Freshness”. The foregoing example is merely used to explain thisapplication and shall not be construed as a limitation.

The following specifically describes a process in which the terminalperforms feature tag fusion on a common feature tag of the user and aphotographing feature tag of the user in an embodiment of thisapplication.

FIG. 11 shows a feature tag fusion process according to an embodiment ofthis application. As shown in FIG. 11, a common feature tag of a usermay include Female, Young people, Music, Shopping, Travel, and Socialactivity. A photographing feature tag of the user may include Lightbeautification, Freshness, and Japanese style. Each common feature tagand each photographing feature tag correspond to a score. For example, ascore corresponding to Female and Light beautification is x1, a scorecorresponding to Female and Freshness is y1, and a score correspondingto Female and Japanese style is z1. A score corresponding to Youngpeople and Light beautification is x2, a score corresponding to Youngpeople and Freshness is y2, and a score corresponding to Young peopleand Japanese style is z2. A score corresponding to Music and Lightbeautification is x3, a score corresponding to Music and Freshness isy3, and a score corresponding to Music and Japanese style is z3. A scorecorresponding to Shopping and Light beautification is x4, a scorecorresponding to Shopping and Freshness is y4, and a score correspondingto Shopping and Japanese style is z4. A score corresponding to Traveland Light beautification is x5, a score corresponding to Travel andFreshness is y5, and a score corresponding to Travel and Japanese styleis z5. A score corresponding to Social activity and Light beautificationis x6, a score corresponding to Social activity and Freshness is y6, anda score corresponding to Social activity and Japanese style is z6.

A fusion weight of the common feature tag of the user is L1, and afusion weight of the photographing feature tag of the user is L2. Afusion feature tag obtained after the terminal performs feature tagfusion is the same as the photographing feature tag of the user. Inother words, the fusion feature tag may include Light beautification,Freshness, and Japanese style. A fusion feature tag score T1corresponding to the fusion feature tag “Light beautification” may beobtained through calculation by using the following Formula (1):T1=L1*(x1+x2+x3+x4+x5+x6)+L2*1  Formula (1)

In the foregoing Formula (1), L1 is the fusion weight of the commonfeature tag of the user, L2 is the fusion weight of the photographingfeature tag of the user, x1 is a score corresponding to the commonfeature tag “Female” and the photographing feature tag “Lightbeautification”, x2 is a score corresponding to the common feature tag“Young people” and the photographing feature tag “Light beautification”,x3 is a score corresponding to the common feature tag “Music” and thephotographing feature tag “Light beautification”, x4 is a scorecorresponding to the common feature tag “Shopping” and the photographingfeature tag “Light beautification”, x5 is a score corresponding to thecommon feature tag “Travel” and the photographing feature tag “Lightbeautification”, and x6 is a score corresponding to the common featuretag “Social activity” and the photographing feature tag “Lightbeautification”.

A fusion feature tag score T2 corresponding to the fusion feature tag“Light beautification” may be obtained through calculation by using thefollowing Formula (2):T2=L1*(y1+y2+y3+y4+y5+y6)+L2*1  Formula (2)

In the foregoing Formula (2), L1 is the fusion weight of the commonfeature tag of the user, L2 is the fusion weight of the photographingfeature tag of the user, y1 is a score corresponding to the commonfeature tag “Female” and the photographing feature tag “Freshness”, y2is a score corresponding to the common feature tag “Young people” andthe photographing feature tag “Freshness”, y3 is a score correspondingto the common feature tag “Music” and the photographing feature tag“Freshness”, y4 is a score corresponding to the common feature tag“Shopping” and the photographing feature tag “Freshness”, y5 is a scorecorresponding to the common feature tag “Travel” and the photographingfeature tag “Freshness”, and y6 is a score corresponding to the commonfeature tag “Social activity” and the photographing feature tag“Freshness”.

A fusion feature tag score T3 corresponding to the fusion feature tag“Light beautification” may be obtained through calculation by using thefollowing Formula (3):T3=L1*(z1+z2+z3+z4+z5+z6)+L2*1  Formula (3)

In the foregoing Formula (3), L1 is the fusion weight of the commonfeature tag of the user. L2 is the fusion weight of the photographingfeature tag of the user, z1 is a score corresponding to the commonfeature tag “Female” and the photographing feature tag “Japanese style”,z2 is a score corresponding to the common feature tag “Young people” andthe photographing feature tag “Japanese style”, z3 is a scorecorresponding to the common feature tag “Music” and the photographingfeature tag “Japanese style”, z4 is a score corresponding to the commonfeature tag “Shopping” and the photographing feature tag “Japanesestyle”, z5 is a score corresponding to the common feature tag “Travel”and the photographing feature tag “Freshness”, and z6 is a scorecorresponding to the common feature tag “Social activity” and thephotographing feature tag “Japanese style”.

For example, the fusion weight L1 of the common feature tag of the usermay be 0.6, and the fusion weight L2 of the common feature tag of theuser may be 0.4. The score corresponding to the common feature tag andthe photographing feature tag may be shown Table 16 below.

TABLE 16 Score corresponding to a common feature fag and a photographingfeature tag Photographing feature tag Common feature tag Lightbeautification Freshness Japanese style Female x1 = 0.3 y1 = 0.5 z1 =0.2 Young people x2 = 0.2 y2 = 0.7 z1 = 0.1 Music x3 = 0.4 Y3 = 0.2 z1 =0.4 Shopping x4 = 0.3 Y4 = 0.6 z1 = 0.1 Travel x5 = 0.3 Y5 = 0.3 z1 =0.4 Social activity x6 = 0.4 Y6 = 0.3 z1 = 0.3

Based on Table 16, Formula (1). Formula (2), and Formula (3), theterminal may obtain the following through calculation: A fusion tagscore T1 corresponding to the fusion feature tag “Light beautification”is 1.54, a fusion tag score T2 corresponding to the fusion feature tag“Freshness” is 1.96, and a fusion tag score T3 corresponding to thefusion feature tag “Japanese style” is 1.3. A fusion feature tag with ahighest fusion feature tag score is Freshness.

The terminal may determine the fusion feature tag with the highestfusion feature tag score as an intelligent photographing tag of theuser, and store the intelligent photographing tag in the database of theuser. The intelligent photographing tag of the user may be used by theterminal to set a PQ effect parameter of a picture taken for the userduring photographing.

The following describes the PQ effect parameter that is set when theuser uses an intelligent photographing function to perform photographingin this embodiment of this application.

As shown in FIG. 12, a PQ effect parameter set corresponding to eachfusion feature tag may be prestored in a terminal. For example, a PQeffect parameter set corresponding to a fusion feature tag “Lightbeautification” is a parameter set 1, a PQ effect parameter setcorresponding to a fusion feature tag “Freshness” is a parameter set 2,and a PQ effect parameter set corresponding to a fusion feature tag“Japanese style” is a parameter set 3.

After calculating a fusion feature tag score corresponding to eachfusion feature tag, the terminal may perform picture processing on apicture captured by the terminal during photographing, by using a PQeffect parameter set corresponding to a fusion feature tag (that is, anintelligent photographing tag) with a highest fusion feature tag score,to obtain a picture through intelligent photographing. For example, thefusion feature tag (that is, the intelligent photographing tag) with thehighest fusion feature tag score may be “Freshness”, and a PQ effectparameter set corresponding to the intelligent photographing tag“Freshness” is the parameter set 3. In other words, the terminal mayperform picture processing on the picture captured by the terminalduring photographing, by using the parameter set 3, to obtain thepicture through intelligent photographing.

In the intelligent photographing method provided in this embodiment ofthis application, the terminal may collect user data, extract a featuretag of the user, and assist, based on the feature tag, the user inphotographing with a photographing effect that conforms to a feature ofthe user, to provide the photographing effect that conforms to apersonality of the user for the user, thereby improving user experience.

FIG. 13 shows a user database 1300 constructed by a data storage modulein an intelligent photographing system according to an embodiment ofthis application. As shown in FIG. 13, the user database 1300 mayinclude user data collected by a terminal, valid data obtained afterpreprocessing the collected user data, and feature value datacorresponding to a feature tag of a user.

The user data may include common data and photographing-related data.

The valid data may include a photographing parameter (for example, aphotographing parameter set 1, a photographing parameter set 2, and aphotographing parameter set 3), a PQ effect parameter (for example, a PQeffect parameter set 1, a PQ effect parameter set 2, and a PQ effectparameter set 3), and valid common data (for example, data 1, data 2,and data 3).

The feature value data may include a common feature value (for example,a common feature ID 1, a common feature ID 2, and a common feature ID3), a photographing-related feature value (for example, aphotographing-related feature ID 1, a photographing-related feature ID2, and a photographing-related feature ID 3), and a fusion feature value(for example, a fusion feature ID 1, a fusion feature ID 2, and a fusionfeature ID 3). The common feature value is used to indicate a commonfeature tag of the user, and each common feature value corresponds toone common feature tag. The photographing-related feature value is usedto indicate a photographing feature tag of the user, and each commonfeature value corresponds to one common feature tag. The fusion featurevalue is used to indicate a fusion feature tag of the user, and eachfusion feature value corresponds to one fusion feature tag.

In this embodiment of this application, the user database 1300 is merelyused to explain this application and shall not be construed as alimitation. In specific implementation, the user database 1300 mayinclude more information, for example, a PQ effect parameter setcorresponding to a fusion feature tag.

FIG. 14 is a schematic flowchart of an intelligent photographing methodaccording to this application. As shown in FIG. 14, the intelligentphotographing method includes the following steps.

S1401. A terminal extracts one or more first tags from common data of auser. The common data is used to represent an identity feature of theuser.

The common data of the user may include basic personal information,behavior and a habit, an interest and a hobby, and the like of the user.The basic personal information may include Gender, Year of birth,Habitual residence, and the like. The behavior and the habit may includea most frequently used APP, an APP with a longest use time, an APP thatis used after a headset is plugged in, a frequently visited place, abedtime, a wake-up time, and the like of the user. The interest and thehobby may include a reading preference, an Internet browsing habit, andthe like. For a procedure in which the terminal collects the user data,refer to the foregoing embodiments. Details are not described hereinagain.

For example, the one or more first tags extracted by the terminal may bea common feature tag of the user in the foregoing embodiments, forexample, the common feature tag of the user in Table 12. The commonfeature tag of the user is Female, Young people, Music, Shopping,Travel, and Social activity. For a process in which the terminalextracts the one or more first tags from the common data of the user,refer to the foregoing common data feature extraction procedure in theembodiment shown in FIG. 9. Details are not described herein again.

S1402. The terminal extracts one or more second tags fromphotographing-related data of the user. The photographing-related datais used to represent a photographing preference of the user.

The photographing-related data of the user may include a photographingpreference, a picture browsing habit, and the like of the user. Thephotographing preference of the user includes a photographing parameter,a photographing mode, photographed content, and the like. The picturebrowsing habit includes a shared picture, a deleted picture, a collectedpicture, an edited picture, and the like.

For example, the photographing parameter may include White balance, ISO,Exposure compensation, Shutter speed, Focusing mode. Metering mode,Luminance, Saturation, Contrast, Acutance, and the like. Thephotographing mode may include a common photographing mode, an aperturemode, a portrait mode, a food mode, a monochrome camera mode, aprofessional photographing mode, a 3D dynamic panorama mode, an HDRphotographing mode, and the like. The foregoing examples are merely usedto explain this application and shall not be construed as a limitation.

For example, the one or more second tags extracted by the terminal maybe a photographing feature tag of the user in the foregoing embodiments.For example, the one or more second tags may be the photographingfeature tag of the user that is shown in Table 15. The photographingfeature tag of the user is Light beautification. Freshness, or Japanesestyle. The foregoing examples are merely used to explain thisapplication and shall not be construed as a limitation.

For a process in which the terminal extracts the one or more second tagsfrom the photographing-related data of the user, refer to the foregoingphotographing-related data feature extraction procedure in theembodiment shown in FIG. 10. Details are not described herein again.

S1403. The terminal determines a third tag based on the one or morefirst tags and the one or more second tags.

The third tag may be an intelligent photographing tag in the foregoingembodiments, for example, the intelligent photographing tag in FIG. 12:Freshness. For a process in which the terminal determines the third tagbased on the one or more first tags and the one or more second tags,refer to the foregoing feature tag fusion procedures shown in FIG. 11and FIG. 12. Details are not described herein again.

S1404. The terminal adjusts, based on a picture quality effect parameterset corresponding to the third tag, picture quality of a picture takenby the terminal.

The picture quality (picture quality, PQ) effect parameter set may beused by the terminal to perform picture quality effect adjustment on ataken picture, for example, picture quality adjustment such as contrastadjustment, luminance adjustment, color saturation adjustment, hueadjustment, definition adjustment (for example, digital noise reduction(digital noise reduction. DNR) adjustment), and color edge enhancement(chroma TI, CTI) adjustment.

For example, the third tag may be the intelligent photographing tag inthe embodiment shown in FIG. 12: Freshness, and the picture qualityeffect parameter set corresponding to the third tag may be the parameterset 3 in the embodiment shown in FIG. 12. For specific content, refer tocontent in the embodiment in FIG. 12. Details are not described hereinagain.

In a possible case, that the terminal extracts the one or more firsttags from common data may specifically include: The terminal extracts,based on a first mapping relationship, the one or more first tagscorresponding to the common data. The first mapping relationshipincludes mapping between a plurality of groups of common data and aplurality of first tags.

For example, the first mapping relationship may be a pre-training commonfeature tag library shown in Table 11 in the foregoing embodiment. Byusing the pre-training common feature tag library, the one or more firsttags (Female, Young people, Music, Shopping, Travel. and Socialactivity) may be extracted from the common data. The foregoing exampleis merely used to explain this application and shall not be construed asa limitation. In this way, the terminal may match the common data withthe first mapping relationship, to obtain a common feature tag of theuser, that is, the first tag. Therefore, the terminal can quicklyextract the common feature tag of the user.

In a possible case, that the terminal extracts one or more first tagsfrom photographing-related data may specifically include: First, theterminal extracts one or more first photographing-related parameter setsfrom the photographing-related data. Then, the terminal inputs the oneor more first photographing-related parameter sets to a first neuralnetwork model, to obtain one or more first score vector sets. The firstscore vector set includes first scores of a plurality of fourth tags,and the first score is used to represent a matching degree between thefirst photographing-related parameter set and the fourth tag. Next, theterminal determines the one or more second tags in the plurality offourth tags based on the first score vector sets respectivelycorresponding to the one or more first photographing-related parametersets.

For example, the first neural network model may be a convolutionalneural network (convolutional neural network, CNN). The firstphotographing-related parameter set includes a photographing parameterset {a1, a2, a3, . . . } and a PQ effect parameter set {b1, b2, b3, . .. } of the photographing-related data. The plurality of fourth tags maybe photographing feature tags (for example, Heavy beautification. Lightbeautification. Freshness, Japanese style, European and American style,and Freshness+Light beautification) in the example shown in Table 14.For the first score vector set, refer to the photographing feature tagscore vector set S in the example shown in Table 14. For specificcontent, refer to the example shown in FIG. 10. Details are notdescribed herein again. In other words, the terminal may extract thefeature tag from the photographing-related data by using the neuralnetwork model. In this way, the terminal may use a self-learningcapability of the neural network model to improve accuracy of extractingthe feature tag from the photographing-related data by the terminal.

In a possible case, the one or more second tags include one or morefourth tags whose first scores are greater than a first threshold in thefirst score vector sets respectively corresponding to the one or morefirst photographing-related parameter sets.

For example, the first threshold may be 0.7. With reference to Table 14,it can be learned that the photographing feature tag of the user mayinclude “Freshness”. For specific content, refer to the embodimentsshown in Table 14 and Table 15. Details are not described herein again.

In a possible case, the one or more second tags include one or morefourth tags whose first scores are the highest in a first score vectorset corresponding to each first photographing-related parameter set.

For example, the one or more second tags may be the photographingfeature tag (for example, Light beautification, Freshness, and Japanesestyle) of the user that is shown in Table 15. For specific content,refer to the embodiments shown in Table 14 and Table 15. Details are notdescribed herein again. In other words, the terminal may determine, asthe one or more second tags, the one or more fourth tags whose fourthscores are greater than the first threshold. Because a value of thefirst score is used to indicate a matching degree between the user andthe fourth tag, a larger value of the first score indicates a highermatching degree between the photographing-related data of the user andthe fourth tag. In this way, the terminal may extract the one or moresecond tags that conform to a photographing-related data feature of theuser.

In a possible case, before the terminal inputs the one or more firstphotographing-related parameter sets to the first neural network model,the terminal may obtain sample data. The sample data includes aplurality of groups of first training sets. Each group of first trainingsets include one group of second photographing-related parameter setsand one group of second score vector sets. The terminal trains the firstneural network model based on the sample data by using a deep learningalgorithm.

For example, the first training set may be the training parameter setQ{P→S} in the embodiment shown in FIG. 10. Herein, P includes aphotographing parameter set and a PQ effect parameter set, and S is ascore of a photographing feature tag (for example, Heavy beautification,Light beautification, Freshness, or Japanese style). The secondphotographing-related parameter set may include a photographingparameter and a PQ effect parameter. The second score vector set mayinclude a score of a photographing feature tag (for example, Heavybeautification, Light beautification, Freshness, or Japanese style). Forspecific content, refer to the embodiment shown in FIG. 10. Details arenot described herein again. In other words, the terminal extracts theone or more fourth tags with the highest first scores in the first scorevector sets of the user, and determines the one or more second tags. Inthis way, the terminal can improve accuracy of extracting the one ormore second tags of the user.

In a possible case, the terminal displays a first interface. The firstinterface includes a plurality of sample pictures. Each sample picturecorresponds to one group of second photographing-related parameter setsand one group of second score vector sets. The secondphotographing-related parameter set is used to represent picture qualityof the sample picture, and the second score vector set includes firstscores of a plurality of fourth tags corresponding to the samplepicture. The terminal receives a first input operation of selecting oneor more training pictures from the plurality of sample pictures by theuser. In response to the first input operation, the terminal maydetermine, as the sample data, the second photographing-relatedparameter sets and the second score vector sets corresponding to the oneor more training pictures.

For example, the first interface may be the user preference surveyinterface 440 shown in FIG. 4d or the user preference survey interface530 shown in FIG. 5b . The sample picture may be the picture a, thepicture b, the picture c, the picture d, and the like in the userpreference survey interface 440 or the user preference survey interface530. The first input operation may be the input operation 442 shown inFIG. 4d or the input operation 532 shown in FIG. 5b . For specificcontent, refer to the embodiment shown in FIG. 4 or FIG. 5. Details arenot described herein again. In other words, the terminal may train thefirst neural network model by using sample data corresponding to asample picture preselected by the user. In this way, the terminal mayextract one or more second feature tags that conform to a personalizedphotographing preference of the user.

In a possible case, the terminal may determine whether a quantity ofsample pictures is less than a training quantity. If the quantity ofsample pictures is less than the training quantity, the terminalselects, as the sample data, one or more groups of secondphotographing-related parameter sets and second score vector sets from aprestored training set database. For specific content, refer to theembodiment shown in FIG. 10b . Details are not described herein again.In other words, the terminal may use a prestored training set to train afirst neural network when the quantity of sample pictures selected bythe user is insufficient, thereby reducing input operations of the userand improving user experience. In a possible case, each first tag andeach second tag jointly correspond to an association score. A value ofthe association score is used to represent an association degree betweenthe first tag and the second tag. The terminal may determine a totalassociation score of each second tag based on the one or more first tagsand the one or more second tags, to obtain T_(i)=L₁*(Σ_(k=1)^(R)W_(k))+L₂. Herein. T_(i) is a total association score of an i^(th)second tag in the one or more second tags, L₁ is a weight of the one ormore first tags. L₂ is a weight of the one or more second tags, W_(k) isan association score corresponding to a k^(th) first tag in the one ormore first tags and the i^(th) second tag jointly, and R is a quantityof the one or more first tags. Then, the terminal determines the thirdtag based on the total association score of each second tag. The thirdtag is a tag with a highest total association score in the one or moresecond tags.

For example, the association score may be a score (for example, x1, x2,x3, x4, x5, x6; y1, y2, y3, y4, y5, y6; z1, z2, z3, z4, z5, z6 in theembodiment shown in FIG. 11) corresponding to the common feature tag andthe photographing feature tag in the embodiment shown in FIG. 11.Reference may be made to the embodiment shown in FIG. 16. The third tagmay be the intelligent photographing tag in the embodiment shown in FIG.11. For the total association score of each second tag, refer to thefusion feature tag scores T1, T2, and T3 in the embodiment shown in FIG.11. For specific content, refer to the embodiment shown in FIG. 11.Details are not described herein again. In other words, the terminal mayset a weight for the first tag of the user and a weight for the secondtag of the user, and set an association degree value corresponding toeach first tag and each second tag. In this way, the terminal canrecommend a picture quality adjustment parameter to the user, to betterconform to a personalized preference of the user, thereby improving userexperience.

In this embodiment of this application, the terminal may collect userdata, extract the first tag indicating the identity feature of the user,extract the second tag indicating the photographing preference of theuser, and obtain the third tag of the user through fusion based on thefirst tag and the second tag. In other words, the third tag is obtainedthrough fusing the identity feature of the user with the photographingpreference of the user. Then, the terminal assists, by using the picturequality effect parameter set corresponding to the third tag, the user inphotographing with a photographing effect conforming to a user feature,and provides the user with the photographing effect conforming to a userpersonality, thereby improving user experience.

In conclusion, the foregoing embodiments are merely intended fordescribing the technical solutions of this application, but not forlimiting this application. Although this application is described indetail with reference to the foregoing embodiments, persons of ordinaryskill in the art should understand that they may still makemodifications to the technical solutions described in the foregoingembodiments or make equivalent replacements to some technical featuresthereof, without departing from the scope of the technical solutions ofthe embodiments of this application.

What is claimed is:
 1. An intelligent photographing method implementedby a terminal, wherein the method comprises: extracting, based on afirst mapping relationship, one or more first tags from common data of auser, wherein the common data represents an identity feature of theuser, and wherein the first mapping relationship comprises mappingsbetween a plurality of groups of the common data and a plurality of theone or more first tags; extracting one or more second tags fromphotographing-related data of the user, wherein thephotographing-related data represents a photographing preference of theuser; determining, based on the one or more first tags and the one ormore second tags, a third tag; taking a picture; and adjusting, based ona picture quality effect parameter set corresponding to the third tag, apicture quality of the picture.
 2. The intelligent photographing methodof claim 1, further comprising: extracting, from thephotographing-related data, one or more first photographing-relatedparameter sets; inputting the one or more first photographing-relatedparameter sets to a first neural network model to obtain one or morefirst score vector sets, wherein the one or more first score vector setscomprise first scores of a plurality of fourth tags, and wherein each ofthe first scores represents a matching degree between a correspondingfirst photographing-related parameter set and a corresponding fourthtag; and determining, based on the first score vector sets, the one ormore second tags in the fourth tags.
 3. The intelligent photographingmethod of claim 2, wherein the one or more second tags comprise one ormore fourth tags having first scores that are greater than a firstthreshold.
 4. The intelligent photographing method of claim 2, whereinthe one or more second tags comprise one or more fourth tags havingfirst scores that are highest in a first score vector set correspondingto each of the one or more first photographing-related parameter sets.5. The intelligent photographing method of claim 2, wherein beforeinputting the one or more first photographing-related parameter sets tothe first neural network model, the intelligent photographing methodfurther comprises: obtaining sample data comprising a plurality ofgroups of first training sets, wherein each of the groups of the firsttraining sets comprises one group of second photographing-relatedparameter sets and one group of second score vector sets; and trainingthe first neural network model based on the sample data using a deeplearning algorithm.
 6. The intelligent photographing method of claim 5,further comprising: displaying a first interface comprising a pluralityof sample pictures, wherein each of the sample pictures corresponds tothe one group of the second photographing-related parameter sets and theone group of the second score vector sets, wherein each of the secondphotographing-related parameter sets represents picture qualities of thesample pictures, and wherein each of the second score vector setscomprises first scores of a second plurality of fourth tagscorresponding to the sample pictures; receiving, from the user, a firstinput operation of selecting one or more training pictures from thesample pictures; and setting, in response to the first input operation,the one or more first photographing-related parameter sets and thesecond score vector sets that are corresponding to the one or moretraining pictures as the sample data.
 7. The intelligent photographingmethod of claim 6, further comprising: determining whether a quantity ofthe sample pictures is less than a training quantity; and extracting oneor more groups of the first training sets from a prestored training setdatabase as the sample data when the quantity of the sample pictures isless than the training quantity.
 8. The intelligent photographing methodof claim 1, wherein each of the one or more first tags and each of theone or more second tags jointly correspond to an association score,wherein a value of the association score represents a degree ofassociation between each of the one or more first tags and each of theone or more second tags, and wherein the intelligent photographingmethod further comprises: determining a total association score of theeach of the one or more second tags based on the one or more first tagsand the one or more second tags using a formula:${T_{i} = {{L_{1}*\left( {\sum\limits_{k = 1}^{R}W_{k}} \right)} + L_{2}}},$wherein T_(i) is a total association score of an i^(th) second tag inthe one or more second tags, wherein L₁ is a weight of the one or morefirst tags, wherein L₂ is a weight of the one or more second tags,wherein W_(k) is an association score corresponding to a k^(th) firsttag in the one or more first tags and the i^(th) second tag, and whereinR is a quantity of the one or more first tags; and determining, based onthe total association score, the third tag, wherein the third tag iswith a highest total association score in the one or more second tags.9. An electronic device comprising: a memory configured to storeinstructions; and a processor coupled to the memory, wherein theinstructions cause the processor to be configured to: extract, based ona first mapping relationship, extract one or more first tags from commondata of a user, wherein the common data represents an identity featureof the user, and wherein the first mapping relationship comprisesmapping between a plurality of groups of the common data and a pluralityof the one or more first tags; extract one or more second tags fromphotographing-related data of the user, wherein thephotographing-related data represents a photographing preference of theuser; determine, based on the one or more first tags and the one or moresecond tags, a third tag; take a picture; and adjust, based on a picturequality effect parameter set corresponding to the third tag, a picturequality of the picture.
 10. The electronic device of claim 9, whereinthe instructions further cause the electronic device to: extract, fromthe photographing-related data, one or more first photographing-relatedparameter sets; input the one or more first photographing-relatedparameter sets to a first neural network model to obtain one or morefirst score vector sets, wherein the one or more first score vector setscomprise first scores of a plurality of fourth tags, and wherein each ofthe first scores represents a matching degree between a correspondingfirst photographing-related parameter set and a corresponding fourthtag; and determine, based on the first score vector sets, the one ormore second tags in the fourth tags.
 11. The electronic device of claim10, wherein the one or more second tags comprise one or more fourth tagshaving first scores that are greater than a first threshold.
 12. Theelectronic device of claim 10, wherein the one or more second tagscomprise one or more fourth tags having first scores that are highest ina first score vector set corresponding to each of the one or more firstphotographing-related parameter sets.
 13. The electronic deviceaccording to claim 10, wherein the instructions further cause theprocessor to be configured to: obtain sample data comprising a pluralityof groups of first training sets, wherein each of the groups of thefirst training sets comprises one group of second photographing-relatedparameter sets and one group of second score vector sets; and train thefirst neural network model based on the sample data using a deeplearning algorithm.
 14. The electronic device of claim 13, wherein theinstructions further cause the processor to be configured to: display afirst interface comprising a plurality of sample pictures, wherein eachof the sample pictures corresponds to the one group of the secondphotographing-related parameter sets and the one group of the secondscore vector sets, wherein each of the second photographing-relatedparameter sets represents picture qualities of the sample pictures, andwherein each of the second score vector sets comprises first scores of asecond plurality of fourth tags corresponding to the sample pictures;receive, from the user, a first input operation of selecting one or moretraining pictures from the sample pictures; and set, in response to thefirst input operation, the one or more first photographing-relatedparameter sets and the second score vector sets that are correspondingto the one or more training pictures as the sample data.
 15. Theelectronic device of claim 14, wherein the instructions further causethe processor to be configured to: determine whether a quantity of thesample pictures is less than a training quantity; and extract one ormore groups of the first training sets from a prestored training setdatabase as the sample data when the quantity of the sample pictures isless than the training quantity.
 16. The electronic device of claim 9,wherein each of the one or more first tags and each of the one or moresecond tags jointly correspond to an association score, wherein a valueof the association score represents a degree of association between eachof the one or more first tags and each of the one or more second tags,and wherein the instructions further cause the processor to beconfigured to: determine a total association score of the each of theone or more second tags based on the one or more first tags and the oneor more second tags using a formula:${T_{i} = {{L_{1}*\left( {\sum\limits_{k = 1}^{R}W_{k}} \right)} + L_{2}}},$wherein T_(i) is a total association score of an i^(th) second tag inthe one or more second tags, wherein L₁ is a weight of the one or morefirst tags, wherein L₂ is a weight of the one or more second tags,wherein W_(k) is an association score corresponding to a k^(th) firsttag in the one or more first tags and the i^(th) second tag, and whereinR is a quantity of the one or more first tags; and further determine,based on the total association score, the third tag, wherein the thirdtag is with a highest total association score in the one or more secondtags.
 17. A computer program product comprising computer-executableinstructions stored on a non-transitory computer-readable medium that,when executed by a processor, cause an apparatus to: extract, based on afirst mapping relationship, one or more first tags from common data of auser, wherein the common data represents an identity feature of theuser, and wherein the first mapping relationship comprises mappingbetween a plurality of groups of the common data and a plurality of theone or more first tags; extract one or more second tags fromphotographing-related data of the user, wherein thephotographing-related data represents a photographing preference of theuser; determine, based on the one or more first tags and the one or moresecond tags, a third tag; take a picture; and adjust, based on a picturequality effect parameter set corresponding to the third tag, a picturequality of the picture.
 18. The computer program product of claim 17,wherein the instructions further cause the apparatus to: extract, fromthe photographing-related data, one or more first photographing-relatedparameter sets; input the one or more first photographing-relatedparameter sets to a first neural network model to obtain one or morefirst score vector sets, wherein the one or more first score vector setscomprise first scores of a plurality of fourth tags, and wherein each ofthe first scores represents a matching degree between a correspondingfirst photographing-related parameter set and a corresponding fourthtag; and determine, based on the first score vector sets, the one ormore second tags in the fourth tags.
 19. The computer program product ofclaim 17, wherein each of the one or more first tags and each of the oneor more second tags jointly correspond to an association score, whereina value of the association score represents a degree of associationbetween each of the one or more first tags and each of the one or moresecond tags, and wherein the instructions further cause the apparatusto: determine a total association score of the each of the one or moresecond tags based on the one or more first tags and the one or moresecond tags using a formula:${T_{i} = {{L_{1}*\left( {\sum\limits_{k = 1}^{R}W_{k}} \right)} + L_{2}}},$wherein T_(i) is a total association score of an i^(th) second tag inthe one or more second tags, wherein L₁ is a weight of the one or morefirst tags, wherein L₂ is a weight of the one or more second tags,wherein W_(k) is an association score corresponding to a k^(th) firsttag in the one or more first tags and the i^(th) second tag, and whereinR is a quantity of the one or more first tags; and determine, based onthe total association score, the third tag, wherein the third tag iswith a highest total association score in the one or more second tags.